I actually caught that already and changed it.  Still getting the same
problem.  I was using cl_build() first however I switched over to
cl_buildtrie() to see if that would make a difference.  No luck with
either ones being changed.

- Ben


On Wed, 2006-08-16 at 08:11 -0400, Brian Bebeau wrote:
> 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.
> 

_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to