提交 a8f50345 编写于 作者: K KAMBAROV, ZAUR 提交者: Linus Torvalds

[PATCH] coverity: i386: build.c: negative return to unsigned fix

Variable "c" was declared as an unsigned int, but used in:

125  		for (i=0 ; (c=read(fd, buf, sizeof(buf)))>0 ; i+=c )
126  			if (write(1, buf, c) != c)
127  				die("Write call failed");

(akpm: read() can return -1.  If it does, we fill the disk up with garbage).
Signed-off-by: NZaur Kambarov <zkambarov@coverity.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 4cceb4d1
......@@ -70,7 +70,8 @@ void usage(void)
int main(int argc, char ** argv)
{
unsigned int i, c, sz, setup_sectors;
unsigned int i, sz, setup_sectors;
int c;
u32 sys_size;
byte major_root, minor_root;
struct stat sb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册