forked from osmocom/wireshark
print.c: add length check to loop
Note that it was impossible to actually overflow the buffer, and there is a check to flush and restart if it gets to within a few bytes of the end, but static analyzers (CID: 1477927) are unlikely to be able to work this out.
This commit is contained in:
parent
30f3d72061
commit
8e099bb0c7
|
@ -1812,7 +1812,7 @@ print_escaped_xml(FILE *fh, const char *unescaped_string)
|
|||
return;
|
||||
}
|
||||
|
||||
for (p = unescaped_string; *p != '\0'; p++) {
|
||||
for (p = unescaped_string; *p != '\0' && (offset<(ESCAPED_BUFFER_MAX-1)); p++) {
|
||||
switch (*p) {
|
||||
case '&':
|
||||
(void) g_strlcpy(&temp_buffer[offset], "&", ESCAPED_BUFFER_MAX-offset);
|
||||
|
|
Loading…
Reference in New Issue