Fix Coverity error triggered in utf8_get_next_char()

This commit is contained in:
matt335672
2025-01-24 11:21:32 +00:00
parent 64cfeb3acd
commit 0f46b7961c
+2 -2
View File
@@ -1191,7 +1191,7 @@ utf8_get_next_char(const char **utf8str_ref, unsigned int *len_ref)
/*
* Macro used to parse a continuation character
* @param cp Character Pointer (incremented on success)
* @param end One character past end of input string
* @param end One character past end of input string, or NULL
* @param value The value we're constructing
* @param finish_label Where to go in the event of an error */
#define PARSE_CONTINUATION_CHARACTER(cp, end, value, finish_label) \
@@ -1210,7 +1210,7 @@ utf8_get_next_char(const char **utf8str_ref, unsigned int *len_ref)
/* Easier to work with unsigned chars and no indirection */
const unsigned char *cp = (const unsigned char *)*utf8str_ref;
const unsigned char *end = (len_ref != NULL) ? cp + *len_ref : cp + 6;
const unsigned char *end = (len_ref != NULL) ? cp + *len_ref : NULL;
if (cp == end)
{