RPM Community Forums

Mailing List Message of <rpm-devel>

RE: [CVS] RPM: rpm-5_0: rpm/lib/ rpm4compat.h

From: Hatle, Mark <mark.hatle@windriver.com>
Date: Wed 05 Mar 2008 - 15:49:42 CET
Message-ID: <EBFDFFB87BB22F4AB1B801A86BB41BC70218C399@ala-mail02.corp.ad.wrs.com>
I believe the following chunk of code is now incorrect.  "stpcpy" returns the address to the end of the strip, while strcpy returns the address to the start of the string.  So this stpcpy -> strcpy doesn't take that into account.. so the results look to me like t="\0".

--Mark

From: rpm-cvs-owner@rpm5.org on behalf of Per Øyvind Karlsen
...
>    	for (i = 0; i < (unsigned)count; i++) {
>    		const char * dn = NULL;
>    		(void) urlPath(dirNames.argv[dirIndexes.ui32p[i]], &dn);
>    		fileNames.argv[i] = t;
>   -		t = stpcpy( stpcpy(t, dn), baseNames.argv[i]);
>   +		t = strcpy( strcpy(t, dn), baseNames.argv[i]);
>    		*t++ = '\0';
>    	}
>    	baseNames.ptr = _free(baseNames.ptr);


Received on Wed Mar 5 15:52:08 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.