Re: [PATCH v2] libmount: Fix access to uninitialised value in mnt_optstr_locate_option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



soeren@xxxxxxxxxxxxxxxxx wrote:
>  		xstrncpy(buf, name, namesz + 1);
> +		if (namesz == 0) { /* if xstrncpy didn't copy anything */
> +			free(buf);
> +			buf = NULL;
> +		}

This solution also has the issue that it handles the case incorrectly
where xstrncpy actually calls strlen(3). I wanted to avoid that but
maybe the best solution is to just change the xstrncpy API in a way that
it indicates whether it has written anything through an int return
value?

Sorry for all the noise. Next time, I will just write a bug report...

Greetings,
Sören




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux