aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/utf7.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-02-28 06:57:46 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-02-28 07:16:08 +0000
commitdefabca229899725766edce5ee15609c1099fecc (patch)
tree6b3afffed2319a4ed54a4bec45f856ea9cf8c3c5 /libwc/utf7.c
parentPrevent unintentional integer overflow in Strcat_charp_n (diff)
downloadw3m-defabca229899725766edce5ee15609c1099fecc.tar.gz
w3m-defabca229899725766edce5ee15609c1099fecc.zip
Prevent unintentional integer overflow in libwc
Diffstat (limited to 'libwc/utf7.c')
-rw-r--r--libwc/utf7.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libwc/utf7.c b/libwc/utf7.c
index 44a3330..874bc3d 100644
--- a/libwc/utf7.c
+++ b/libwc/utf7.c
@@ -73,7 +73,7 @@ wc_conv_from_utf7(Str is, wc_ces ces)
;
if (p == ep)
return is;
- os = Strnew_size(is->length * 4 / 3);
+ os = Strnew_size(is->length + is->length / 3);
if (p > sp)
Strcat_charp_n(os, is->ptr, (int)(p - sp));