[VODZ] mke2fs

farmatito at tiscali.it farmatito at tiscali.it
Tue Sep 20 09:51:08 UTC 2005


>-- Messaggio Originale --
>Date: Tue, 20 Sep 2005 11:40:10 +0400
>From: "Vladimir N. Oleynik" <dzo at simtreas.ru>
>To: Tito <farmatito at tiscali.it>
>CC: busybox at busybox.net
>Subject: Re: [VODZ] mke2fs
>
>
>Tito,
>
>> Hi, vodz 
>> in your last changes in mke2fs.c at line 797-803
>> 
>> 	/* Update our PATH to include /sbin  */
>> 	if (oldpath) {
>> 		char *newpath;
>> 
>> 		bb_xasprintf(&newpath, "%s:%s", PATH_SET, oldpath);
>> 	} else
>> 		putenv (PATH_SET);
>> 
>> shouldn't this be:
>> 	/* Update our PATH to include /sbin  */
>> 	if (oldpath) {
>> 		char *newpath;
>> 
>> 		bb_xasprintf(&newpath, "%s:%s", PATH_SET, oldpath);
>>                 putenv (newpath);
>>                 if (ENABLE_FEATURE_CLEAN_UP) free(newpath);
>> 	} else
>> 		putenv (PATH_SET);
>> 
>> as newpath is not used elsewhere.
>
>Oh, replay and replay...
>
>$ man putenv
>....
>However, glibc 2.0-2.1.1 differs: a copy of the string
>is used.  On the one hand this causes a memory leak,
>and on the other hand it violates SUSv2.
>This has been fixed in glibc2.1.2.
>...
>
>I think:
>1) autoconf can`t detect this trivially
>2) maintream don`t think of ENABLE_FEATURE_CLEAN_UP, and we
>have problem in many place
>3) quick patch may be as before return of main
>if (ENABLE_FEATURE_CLEAN_UP && oldpath)
>	free(newpath); /* and moved this var to top */
>
>
>--w
>vodz

Yes,
I was referring mainly to the missing

                putenv (newpath);

Ciao,
Tito


__________________________________________________________________
TISCALI ADSL 1.25 MEGA
Solo con Tiscali Adsl navighi senza limiti e telefoni senza canone Telecom
a partire da 19,95 Euro/mese.
Attivala entro il 31 agosto, il primo MESE è GRATIS! CLICCA QUI.
http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/






More information about the busybox mailing list