use memcpy instead of strcpy to make the dom string copy intention explicit
This commit is contained in:
parent
13a7004e6b
commit
826474a1a3
|
@ -376,14 +376,14 @@ imagemap_addtolist(const struct html_content *c,
|
|||
}
|
||||
|
||||
if (target != NULL) {
|
||||
/* Copy target into the map */
|
||||
/* Copy target dom string into the map data */
|
||||
new_map->target = malloc(dom_string_byte_length(target) + 1);
|
||||
if (new_map->target == NULL)
|
||||
goto bad_out;
|
||||
|
||||
strncpy(new_map->target,
|
||||
dom_string_data(target),
|
||||
dom_string_byte_length(target));
|
||||
memcpy(new_map->target,
|
||||
dom_string_data(target),
|
||||
dom_string_byte_length(target));
|
||||
|
||||
new_map->target[dom_string_byte_length(target)] = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue