Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10390)

Unified Diff: chrome/installer/mac/third_party/bsdiff/goobspatch.c

Issue 287483002: goobspatch: Improve sanity checks for invalid patches. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mac/third_party/bsdiff/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mac/third_party/bsdiff/goobspatch.c
diff --git a/chrome/installer/mac/third_party/bsdiff/goobspatch.c b/chrome/installer/mac/third_party/bsdiff/goobspatch.c
index 418f666200735b203e837e29e0d24b4ea887094d..6d7bff4cd8c90fab4a626a978ac19d455f9b1560 100644
--- a/chrome/installer/mac/third_party/bsdiff/goobspatch.c
+++ b/chrome/installer/mac/third_party/bsdiff/goobspatch.c
@@ -3,7 +3,7 @@
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted providing that the following conditions
+ * modification, are permitted providing that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@@ -470,6 +470,10 @@ int main(int argc,char * argv[])
};
/* Sanity-check */
+ if((ctrl[0]<0) || (ctrl[1]<0))
+ errx(1,"corrupt patch (diff): negative chunk size");
+
+ /* Sanity-check */
if(newpos+ctrl[0]>newsize)
errx(1,"corrupt patch (diff): overrun");
« no previous file with comments | « chrome/installer/mac/third_party/bsdiff/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698