Commit 2c878ef8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

HLS: check strtoull parsing

(cherry picked from commit a7984f0a1cd295f4b80a2003a30dda5ab3b315b0)
(cherry picked from commit cd84eec0f5d64bc4ea6289029cc737e0f8358296)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent bdf63c7e
...@@ -541,15 +541,15 @@ static int string_to_IV(char *string_hexa, uint8_t iv[AES_BLOCK_SIZE]) ...@@ -541,15 +541,15 @@ static int string_to_IV(char *string_hexa, uint8_t iv[AES_BLOCK_SIZE])
if (len <= 16) { if (len <= 16) {
iv_hi = 0; iv_hi = 0;
iv_lo = strtoull(string_hexa, &end, 16); iv_lo = strtoull(string_hexa, &end, 16);
if (end) if (*end)
return VLC_EGENERIC; return VLC_EGENERIC;
} else { } else {
iv_lo = strtoull(&string_hexa[len-16], NULL, 16); iv_lo = strtoull(&string_hexa[len-16], &end, 16);
if (end) if (*end)
return VLC_EGENERIC; return VLC_EGENERIC;
string_hexa[len-16] = '\0'; string_hexa[len-16] = '\0';
iv_hi = strtoull(string_hexa, NULL, 16); iv_hi = strtoull(string_hexa, &end, 16);
if (end) if (*end)
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment