lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Jul 2013 15:29:17 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	Al Viro <viro@...iv.linux.org.uk>,
	George Spelvin <linux@...izon.com>
CC:	reiserfs-devel@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] reiserfs: check/extend buffer length for printing functions

On 07/18/2013 12:28 PM, Chen Gang wrote:
>  
>>  	strcpy(fmt1, fmt);
>> @@ -199,46 +214,51 @@ static void prepare_error_buf(const char *fmt, va_list args)
>>  	while ((k = is_there_reiserfs_struct(fmt1, &what)) != NULL) {
>>  		*k = 0;
>>  
>> -		p += vsprintf(p, fmt1, args);
>> +		p += vsnprintf(p, left, fmt1, args);

At least, need use vscnprintf() instead of vsnprintf(), since we need
the real written length return.

>> +		left = REISERFS_ERR_BUF_LEFT(p, error_buf);
>>  
>>  		switch (what) {
>>  		case 'k':
>> -			sprintf_le_key(p, va_arg(args, struct reiserfs_key *));
>> +			sprintf_le_key(p, left,
>> +				       va_arg(args, struct reiserfs_key *));
>>  			break;
>>  		case 'K':
>> -			sprintf_cpu_key(p, va_arg(args, struct cpu_key *));
>> +			sprintf_cpu_key(p, left,
>> 


-- 
Chen Gang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ