Re: perl, C, and odd things
On Wed, Mar 06, 2002 at 10:16:51PM +0100, Josselin Mouette wrote:
> finalpath = malloc(strlen(datapath) + sizeof(mypath) + 1);
> sprintf(finalpath, "%s%s", datapath, mypath);
> Good. But it has been reported that on at least one Debian system (also
> an up-to-date sid), it leads to :
> open("/usr/share/frozen-bubbledata/plasma.raw", O_RDONLY|O_LARGEFILE) =
> -1 ENOENT (No such file or directory)
Exit value of malloc isn't checked. (Though I don't see how could that
cause the missing "/"...)
Marcin
--
Marcin Owsiany <porridge@debian.org> http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216
Reply to: