Created
August 8, 2012 03:04
-
-
Save anonymous/3291695 to your computer and use it in GitHub Desktop.
src/lib/libc/locale/rune.c: fix memory corruption (was pkgsrc/shells/bash vs PKG_OPTIONS.bash=static)
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/lib/libc/locale/rune.c b/lib/libc/locale/rune.c | |
index 4958757..af2a933 100644 | |
--- a/lib/libc/locale/rune.c | |
+++ b/lib/libc/locale/rune.c | |
@@ -167,7 +167,7 @@ _rune_read_file(const char * __restrict var, size_t lenvar, | |
return EFTYPE; | |
lenvar -= n; | |
- n = sizeof(*rlp) + (len * sizeof(*re)) + lenvar; | |
+ n = sizeof(*rlp) + (len * sizeof(*re)) + lenvar + variable_len; | |
rlp = (_RuneLocalePriv *)malloc(n); | |
if (rlp == NULL) | |
return ENOMEM; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment