vfs301: Assert hex string has 2 or more characters

Otherwise static analysis thinks we may end up allocating a 0 byte
output buffer.
This commit is contained in:
Benjamin Berg 2020-05-04 15:01:27 +02:00 committed by Benjamin Berg
parent 422fc5facf
commit 744a71ce08

View file

@ -177,6 +177,7 @@ translate_str (const char **srcL, gssize *len)
src_len += tmp;
}
g_assert (src_len >= 2);
*len = src_len / 2;
res = g_malloc0 (*len);
dst = res;