Commit 5adb1307 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

https: NULL deref

(in currently unused code)
parent 6c733dc4
...@@ -783,8 +783,10 @@ time_t vlc_http_msg_get_mtime(const struct vlc_http_msg *m) ...@@ -783,8 +783,10 @@ time_t vlc_http_msg_get_mtime(const struct vlc_http_msg *m)
unsigned vlc_http_msg_get_retry_after(const struct vlc_http_msg *m) unsigned vlc_http_msg_get_retry_after(const struct vlc_http_msg *m)
{ {
const char *str = vlc_http_msg_get_header(m, "Retry-After"); const char *str = vlc_http_msg_get_header(m, "Retry-After");
char *end; if (str == NULL)
return 0;
char *end;
unsigned long delay = strtoul(str, &end, 10); unsigned long delay = strtoul(str, &end, 10);
if (end != str && *end == '\0') if (end != str && *end == '\0')
return delay; return delay;
......
...@@ -150,6 +150,7 @@ static time_t parse_date(const char *str) ...@@ -150,6 +150,7 @@ static time_t parse_date(const char *str)
t1 = vlc_http_msg_get_atime(m); t1 = vlc_http_msg_get_atime(m);
assert(vlc_http_msg_add_header(m, "Last-Modified", "%s", str) == 0); assert(vlc_http_msg_add_header(m, "Last-Modified", "%s", str) == 0);
t2 = vlc_http_msg_get_mtime(m); t2 = vlc_http_msg_get_mtime(m);
assert(vlc_http_msg_get_retry_after(m) == 0);
assert(vlc_http_msg_add_header(m, "Retry-After", "%s", str) == 0); assert(vlc_http_msg_add_header(m, "Retry-After", "%s", str) == 0);
vlc_http_msg_get_retry_after(m); vlc_http_msg_get_retry_after(m);
vlc_http_msg_destroy(m); vlc_http_msg_destroy(m);
......
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