mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 04:26:12 +00:00
lib: untrusted argument (Coverity 1448386)
Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
parent
71a7b1f82f
commit
45ec351df2
@ -31,9 +31,11 @@
|
||||
#define pychar wchar_t
|
||||
static wchar_t *wconv(const char *s)
|
||||
{
|
||||
size_t outlen = mbstowcs(NULL, s, 0);
|
||||
size_t outlen = s ? mbstowcs(NULL, s, 0) : 0;
|
||||
wchar_t *out = malloc((outlen + 1) * sizeof(wchar_t));
|
||||
mbstowcs(out, s, outlen + 1);
|
||||
|
||||
if (outlen > 0)
|
||||
mbstowcs(out, s, outlen);
|
||||
out[outlen] = 0;
|
||||
return out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user