Created
March 8, 2013 13:50
-
-
Save kaworu/5116560 to your computer and use it in GitHub Desktop.
Invalid read patch for pkg-ng. see https://github.com/pkgng/pkgng/issues/452
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pkg/progressmeter.c b/pkg/progressmeter.c | |
index fddab1f..a33917c 100644 | |
--- a/pkg/progressmeter.c | |
+++ b/pkg/progressmeter.c | |
@@ -183,7 +183,7 @@ refresh_progress_meter(void) | |
else | |
percent = 100; | |
- snprintf(buf + strlen(buf), win_size - strlen(buf-8), | |
+ snprintf(buf + strlen(buf), win_size - strlen(buf) - 8, | |
" %3d%% ", percent); | |
/* amount transferred */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the context the expression
buf - 8
seems to be an invalid read.