git.samba.org
/
gd
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f5d535
)
util: fixed place where we could look one byte past end of string
author
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 00:03:27 +0000
(11:03 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 01:47:54 +0000
(12:47 +1100)
We need to check the length before the value
lib/util/charset/util_unistr.c
patch
|
blob
|
history
diff --git
a/lib/util/charset/util_unistr.c
b/lib/util/charset/util_unistr.c
index 024dc70acc2748a22b5825b9616f8e46a0d4af5e..045aa4a3e3f4922a4df2c86d13e33425b5d05ae1 100644
(file)
--- a/
lib/util/charset/util_unistr.c
+++ b/
lib/util/charset/util_unistr.c
@@
-483,7
+483,7
@@
_PUBLIC_ char *strupper_talloc_n(TALLOC_CTX *ctx, const char *src, size_t n)
return NULL;
}
- while (
*src && n--
) {
+ while (
n-- && *src
) {
size_t c_size;
codepoint_t c = next_codepoint_convenience(iconv_convenience, src, &c_size);
src += c_size;