View | Details | Raw Unified | Return to bug 204230
Collapse All | Expand All

(-)bsdiff.c (+2 lines)
Lines 231-236 Link Here
231
		that we never try to malloc(0) and get a NULL pointer */
231
		that we never try to malloc(0) and get a NULL pointer */
232
	if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) ||
232
	if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) ||
233
		((oldsize=lseek(fd,0,SEEK_END))==-1) ||
233
		((oldsize=lseek(fd,0,SEEK_END))==-1) ||
234
		(oldsize>=((size_t)~0)) ||
234
		((old=malloc(oldsize+1))==NULL) ||
235
		((old=malloc(oldsize+1))==NULL) ||
235
		(lseek(fd,0,SEEK_SET)!=0) ||
236
		(lseek(fd,0,SEEK_SET)!=0) ||
236
		(read(fd,old,oldsize)!=oldsize) ||
237
		(read(fd,old,oldsize)!=oldsize) ||
Lines 247-252 Link Here
247
		that we never try to malloc(0) and get a NULL pointer */
248
		that we never try to malloc(0) and get a NULL pointer */
248
	if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) ||
249
	if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) ||
249
		((newsize=lseek(fd,0,SEEK_END))==-1) ||
250
		((newsize=lseek(fd,0,SEEK_END))==-1) ||
251
		(newsize>=((size_t)~0)) ||
250
		((new=malloc(newsize+1))==NULL) ||
252
		((new=malloc(newsize+1))==NULL) ||
251
		(lseek(fd,0,SEEK_SET)!=0) ||
253
		(lseek(fd,0,SEEK_SET)!=0) ||
252
		(read(fd,new,newsize)!=newsize) ||
254
		(read(fd,new,newsize)!=newsize) ||

Return to bug 204230