diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-03-04 17:31:26 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-03-04 17:32:41 +0000 |
commit | 826474a1a3707bb837bb1b1aa687d4981acd914d (patch) | |
tree | 5b388be287c9fb706c03cc913e7d5ec3b9ce7e71 /content/handlers/html/imagemap.c | |
parent | 13a7004e6b152494eeab677774cdb626b9e1541d (diff) | |
download | netsurf-826474a1a3707bb837bb1b1aa687d4981acd914d.tar.gz netsurf-826474a1a3707bb837bb1b1aa687d4981acd914d.tar.bz2 |
use memcpy instead of strcpy to make the dom string copy intention explicit
Diffstat (limited to 'content/handlers/html/imagemap.c')
-rw-r--r-- | content/handlers/html/imagemap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/handlers/html/imagemap.c b/content/handlers/html/imagemap.c index d26ba5f4d..0c3576842 100644 --- a/content/handlers/html/imagemap.c +++ b/content/handlers/html/imagemap.c @@ -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; } |