1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

util: fixed place where we could look one byte past end of string

We need to check the length before the value
This commit is contained in:
Andrew Tridgell 2009-10-22 11:03:27 +11:00
parent 3f5d535972
commit dfa0b74516

View File

@ -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;