summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-22 11:03:27 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-22 12:47:54 +1100
commitdfa0b74516349f892b77f384d0c59ae2008199c2 (patch)
tree12fb9f7a1f2cf510a625e6010be7ac9d502d630e
parent3f5d5359726f30b7bdbc2b46da67a0df7e830f33 (diff)
downloadsamba-dfa0b74516349f892b77f384d0c59ae2008199c2.tar.gz
samba-dfa0b74516349f892b77f384d0c59ae2008199c2.tar.bz2
samba-dfa0b74516349f892b77f384d0c59ae2008199c2.zip
util: fixed place where we could look one byte past end of string
We need to check the length before the value
-rw-r--r--lib/util/charset/util_unistr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c
index 024dc70acc..045aa4a3e3 100644
--- 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;