projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6436b37
)
fix overrun (n essentially ignored) in wcsncmp
author
Rich Felker
<dalias@aerifal.cx>
Sat, 26 May 2012 22:04:17 +0000
(18:04 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 26 May 2012 22:04:17 +0000
(18:04 -0400)
bug report and solution by Richard Pennington
src/string/wcsncmp.c
patch
|
blob
|
history
diff --git
a/src/string/wcsncmp.c
b/src/string/wcsncmp.c
index 1b159f41139f47f104f28b8570f9929732abb1b7..4ab32a924c4657dadd98677d4771042f120f43c8 100644
(file)
--- a/
src/string/wcsncmp.c
+++ b/
src/string/wcsncmp.c
@@
-2,6
+2,6
@@
int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n)
{
- for (; n && *l==*r && *l && *r; l++, r++);
+ for (; n && *l==*r && *l && *r;
n--,
l++, r++);
return n ? *l - *r : 0;
}