Merge "fix vulnerability in bspatch"
diff --git a/bspatch.c b/bspatch.c
index 3ef698f..61de4d5 100644
--- a/bspatch.c
+++ b/bspatch.c
@@ -152,6 +152,11 @@
 			ctrl[i]=offtin(buf);
 		};
 
+		// android local change (start)
+		if (ctrl[0]<0||ctrl[1]<0)
+			errx(1,"Corrupt patch\n");
+		// android local change (end)
+
 		/* Sanity-check */
 		if(newpos+ctrl[0]>newsize)
 			errx(1,"Corrupt patch\n");