diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-03-27 11:04:56 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-03-27 11:04:56 +0000 |
commit | d0a30912c83f90595ded23fd3924ba826f498b16 (patch) | |
tree | 77f26ffed44325f92855f7a4f41bf86f1f21dd86 | |
parent | Update ChangeLog (diff) | |
download | w3m-d0a30912c83f90595ded23fd3924ba826f498b16.tar.gz w3m-d0a30912c83f90595ded23fd3924ba826f498b16.zip |
Fix potential integer overflow in allocStr
Diffstat (limited to '')
-rw-r--r-- | indep.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -104,6 +104,8 @@ allocStr(const char *s, int len) return NULL; if (len < 0) len = strlen(s); + if (len < 0 || len >= STR_SIZE_MAX) + len = STR_SIZE_MAX - 1; ptr = NewAtom_N(char, len + 1); if (ptr == NULL) { fprintf(stderr, "fm: Can't allocate string. Give me more memory!\n"); |