projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autoupdate
[gnulib.git]
/
lib
/
wcswidth-impl.h
diff --git
a/lib/wcswidth-impl.h
b/lib/wcswidth-impl.h
index
dc1a60c
..
6347634
100644
(file)
--- a/
lib/wcswidth-impl.h
+++ b/
lib/wcswidth-impl.h
@@
-1,5
+1,5
@@
/* Determine number of screen columns needed for a size-bounded wide string.
/* Determine number of screen columns needed for a size-bounded wide string.
- Copyright (C) 1999, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2011
-2013
Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 1999.
This program is free software: you can redistribute it and/or modify
Written by Bruno Haible <bruno@clisp.org>, 1999.
This program is free software: you can redistribute it and/or modify
@@
-28,6
+28,8
@@
wcswidth (const wchar_t *s, size_t n)
int width = wcwidth (c);
if (width < 0)
goto found_nonprinting;
int width = wcwidth (c);
if (width < 0)
goto found_nonprinting;
+ if (width > INT_MAX - count)
+ goto overflow;
count += width;
}
}
count += width;
}
}
@@
-35,4
+37,7
@@
wcswidth (const wchar_t *s, size_t n)
found_nonprinting:
return -1;
found_nonprinting:
return -1;
+
+ overflow:
+ return INT_MAX;
}
}