Ben Lull wrote:
Hello,
I recently wrote a program which uses libclamav. However, whenever I
scan an infected file (archive, plain file, etc..) the call to
cl_scanfile() segfaults. When I scan a clean file, there is no problem.
I'm guessing this has something to do with how I'm init'ing the virus
database, but thats just a guess. You can take a look at my code at
http://blull.storagefreak.com/main.c The program segfaults on line 242.
I'm pretty stuck here, I've spent the last 12 hours working on this and
have exhausted the mailing archives, irc, and google.
Thanks,
Ben
Good guess. You've declared "struct cl_node **root = NULL;", but it
should be "struct cl_node *root = NULL;" instead. Also, I believe
cl_buildtrie() is deprecated, you should use cl_build() now. See the
API. The only other flag you need is CL_SCAN_BLOCKMAX, CL_SCAN_STDOPT
already includes the rest.
--
Brian Bebeau
SecurePipe, Inc.
[EMAIL PROTECTED]
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html