CVE-2015-5330: Fix handling of unicode near string endings
[samba.git] / lib / util / charset / util_unistr.c
index e4ae65053c733245ad3d0ae792cc0c7679aa04ff..f2992695f65e78a1c2fbbe96d0f63b1593ee912d 100644 (file)
@@ -112,7 +112,8 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
 
        while (n-- && *src) {
                size_t c_size;
-               codepoint_t c = next_codepoint_handle(iconv_handle, src, &c_size);
+               codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
+                                                         CH_UNIX, &c_size);
                src += c_size;
 
                c = toupper_m(c);