mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
In xml_convert, handle the case when repl is the empty string on the
first iteration. This can't happen with the current data definitions, but if it did it would result in memcpy being passed a null pointer. (memcpy would be asked to do a zero-byte copy, so it would probably be okay anyway, but it's better to be safe.)
This commit is contained in:
parent
a02756a5e4
commit
6bd9760f3b
1 changed files with 1 additions and 1 deletions
|
|
@ -912,7 +912,7 @@ char *xml_convert(const char *str) {
|
|||
|
||||
len = strlen(repl);
|
||||
/* Double the size of the result buffer if necessary. */
|
||||
if (i + len > n) {
|
||||
if (i == 0 || i + len > n) {
|
||||
n = (i + len) * 2;
|
||||
result = (char *) safe_realloc(result, n + 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue