From clamav-devel-bounces@lists.clamav.net  Wed Mar 25 19:51:21 2009
Return-Path: <clamav-devel-bounces@lists.clamav.net>
X-Original-To: list@tad.clamav.net
Delivered-To: list@tad.clamav.net
X-Virus-Scanned: Debian amavisd-new at tad.clamav.net
Received: from tad.clamav.net ([127.0.0.1])
	by localhost (tad.clamav.net [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id eVioVpLPPyGb; Wed, 25 Mar 2009 19:51:21 +0100 (CET)
Received: from tad.clamav.net (localhost.localdomain [127.0.0.1])
	by tad.clamav.net (Postfix) with ESMTP id 8E2AE31C178;
	Wed, 25 Mar 2009 19:51:20 +0100 (CET)
X-Original-To: clamav-devel@tad.clamav.net
Delivered-To: clamav-devel@tad.clamav.net
X-Virus-Scanned: Debian amavisd-new at tad.clamav.net
Received: from tad.clamav.net ([127.0.0.1])
	by localhost (tad.clamav.net [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id uKwHFqWxvkzt for <clamav-devel@tad.clamav.net>;
	Wed, 25 Mar 2009 19:51:17 +0100 (CET)
Received: from mail-qy0-f109.google.com (mail-qy0-f109.google.com
	[209.85.221.109])
	by tad.clamav.net (Postfix) with ESMTP id 9182631C172
	for <clamav-devel@lists.clamav.net>;
	Wed, 25 Mar 2009 19:51:17 +0100 (CET)
Received: by qyk7 with SMTP id 7so377841qyk.28
	for <clamav-devel@lists.clamav.net>;
	Wed, 25 Mar 2009 11:51:17 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <49CA7226.5020105@gmail.com>
References: <747dc8f30903250932y441a3031ufb191394cc49280@mail.gmail.com> 
	<49CA6680.6000405@netfarm.it>
	<747dc8f30903251046p5a999673k91da2361819c86be@mail.gmail.com> 
	<747dc8f30903251054h2ce93f93w6a8213d1a3c55c@mail.gmail.com> 
	<49CA7226.5020105@gmail.com>
Date: Wed, 25 Mar 2009 15:51:02 -0300
Received: by 10.220.84.20 with SMTP id h20mr3631039vcl.60.1238007077229; Wed, 
	25 Mar 2009 11:51:17 -0700 (PDT)
Message-ID: <747dc8f30903251151k48aea5cdtf47eb2f7ec57d3ff@mail.gmail.com>
From: Renato Botelho <rbgarga@gmail.com>
To: ClamAV Development <clamav-devel@lists.clamav.net>
Subject: Re: [Clamav-devel] Help to fix some code with new API
X-BeenThere: clamav-devel@lists.clamav.net
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: ClamAV Development <clamav-devel@lists.clamav.net>
List-Id: ClamAV Development <clamav-devel.lists.clamav.net>
List-Unsubscribe: <http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel>,
	<mailto:clamav-devel-request@lists.clamav.net?subject=unsubscribe>
List-Post: <mailto:clamav-devel@lists.clamav.net>
List-Help: <mailto:clamav-devel-request@lists.clamav.net?subject=help>
List-Subscribe: <http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel>,
	<mailto:clamav-devel-request@lists.clamav.net?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: clamav-devel-bounces@lists.clamav.net
Errors-To: clamav-devel-bounces@lists.clamav.net

2009/3/25 T=F6r=F6k Edwin <edwintorok@gmail.com>:
> On 2009-03-25 19:54, Renato Botelho wrote:
>> On Wed, Mar 25, 2009 at 2:46 PM, Renato Botelho <rbgarga@gmail.com> wrot=
e:
>>
>>> On Wed, Mar 25, 2009 at 2:14 PM, Gianluigi Tiesi <sherpya@netfarm.it> w=
rote:
>>>
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> Renato Botelho wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I want to update clamav to 0.95 on FreeBSD ports collection, but,
>>>>> before it I need to have all dependant ports working fine.
>>>>>
>>>>> I've contacted some maintainers / authors and got fixes, but, there
>>>>> are 2 of them missing and I tried to fix it by myself.
>>>>>
>>>>> Could anyone take a look at those patches and let me know if I
>>>>> missed something? They are building fine, but it doesn't mean
>>>>> they are working fine.
>>>>>
>>>>>
>>>> - - limits are gone
>>>> - - you should use cl_engine_set_num() to set maxfilesize and friends
>>>> - - you need cl_init(CL_INIT_DEFAULT)
>>>>
>>
>> Wrong code, now:
>>
>> static struct cl_engine *root;
>>
>> =A0 =A0 =A0 if ((err =3D cl_init(CL_INIT_DEFAULT)))
>> =A0 =A0 =A0 =A0throw cException(CLAMAV_CLASS_NAME,CLAMAV_CLASS_NAME,"cl_=
init",err);
>>
>> =A0 =A0 =A0root =3D cl_engine_new();
>>
>
> You should check for failure here (=3D=3D NULL).

I'll do

>> =A0 =A0 =A0if ((err =3D cl_load(cl_retdbdir(), root, &signo, CL_DB_STDOP=
T)))
>> =A0 =A0 =A0 =A0throw cException(CLAMAV_CLASS_NAME,CLAMAV_CLASS_NAME,"cl_=
load",err);
>>
>> =A0 =A0 =A0if ((err =3D cl_engine_compile(root)))
>> =A0 =A0 =A0 =A0throw cException(CLAMAV_CLASS_NAME,CLAMAV_CLASS_NAME,"cl_=
engine_compile",err);
>>
>> =A0 =A0 =A0cl_engine_free(root);
>>
>
> You should check for error here too.

I'll do too

I'll send those patches to authors and maintainers and ask him to test

Thank you
-- =

Renato Botelho
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

