Skip to content

Instantly share code, notes, and snippets.

@libnex
Last active October 10, 2016 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save libnex/1b25ba272cd1be59e277f3b6d5cfdf02 to your computer and use it in GitHub Desktop.
Save libnex/1b25ba272cd1be59e277f3b6d5cfdf02 to your computer and use it in GitHub Desktop.
Patch for Sec Bug #73280: Stack Buffer Overflow in GD dynamicGetbuf
diff --git a/ext/gd/libgd/gd_io_dp.c b/ext/gd/libgd/gd_io_dp.c.patch
index bfeb4cb..4dcedde 100644
--- a/ext/gd/libgd/gd_io_dp.c
+++ b/Users/elaw/gd_io_dp.c.patch
@@ -237,7 +237,7 @@ static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len)
if (remain >= len) {
rlen = len;
} else {
- if (remain == 0) {
+ if (remain <= 0) {
return EOF;
}
rlen = remain;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment