FreeBSD Bugzilla – Attachment 162714 Details for
Bug 204230
[patch] bsdiff(1) - check file size against SIZE_MAX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed fix
bsdiff.diff (text/plain), 701 bytes, created by
tobias
on 2015-11-02 21:52:26 UTC
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
tobias
Created:
2015-11-02 21:52:26 UTC
Size:
701 bytes
patch
obsolete
>--- bsdiff.c~ Mon Nov 2 22:42:45 2015 >+++ bsdiff.c Mon Nov 2 22:48:41 2015 >@@ -231,6 +231,7 @@ > that we never try to malloc(0) and get a NULL pointer */ > if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) || > ((oldsize=lseek(fd,0,SEEK_END))==-1) || >+ (oldsize>=((size_t)~0)) || > ((old=malloc(oldsize+1))==NULL) || > (lseek(fd,0,SEEK_SET)!=0) || > (read(fd,old,oldsize)!=oldsize) || >@@ -247,6 +248,7 @@ > that we never try to malloc(0) and get a NULL pointer */ > if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) || > ((newsize=lseek(fd,0,SEEK_END))==-1) || >+ (newsize>=((size_t)~0)) || > ((new=malloc(newsize+1))==NULL) || > (lseek(fd,0,SEEK_SET)!=0) || > (read(fd,new,newsize)!=newsize) ||
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204230
: 162714