projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
strstr: Update cross-compilation guess.
[pspp]
/
lib
/
wcswidth-impl.h
diff --git
a/lib/wcswidth-impl.h
b/lib/wcswidth-impl.h
index dc1a60c53213e8b09834655b9991007ce1319694..865390c5e9ee2b760c64d2da7351b54854bc8ad3 100644
(file)
--- a/
lib/wcswidth-impl.h
+++ b/
lib/wcswidth-impl.h
@@
-28,6
+28,8
@@
wcswidth (const wchar_t *s, size_t n)
int width = wcwidth (c);
if (width < 0)
goto found_nonprinting;
+ if (width > INT_MAX - count)
+ goto overflow;
count += width;
}
}
@@
-35,4
+37,7
@@
wcswidth (const wchar_t *s, size_t n)
found_nonprinting:
return -1;
+
+ overflow:
+ return INT_MAX;
}