mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-15 07:09:34 +03:00
fix possible missing null termination (coverity 1195410 and 1195411 )
This commit is contained in:
parent
39b0393d31
commit
d3ddb39102
@ -374,9 +374,9 @@ utf8_to_html(const char *string, const char *encname, size_t len, char **result)
|
||||
if (last_cd.cd)
|
||||
iconv_close(last_cd.cd);
|
||||
|
||||
/* and copy the to/from/cd data into last_cd */
|
||||
strncpy(last_cd.from, "UTF-8", sizeof(last_cd.from));
|
||||
strncpy(last_cd.to, encname, sizeof(last_cd.to));
|
||||
/* and safely copy the to/from/cd data into last_cd */
|
||||
snprintf(last_cd.from, sizeof(last_cd.from), "UTF-8");
|
||||
snprintf(last_cd.to, sizeof(last_cd.to), "%s", encname);
|
||||
last_cd.cd = cd;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user