[vlc-commits] webservices: json: fix null deref

Francois Cartegnie git at videolan.org
Tue Oct 2 19:03:02 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  2 19:02:21 2018 +0200| [c8edcab8cd6c53d39264a59dacbcabe65b2b2c98] | committer: Francois Cartegnie

webservices: json: fix null deref

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c8edcab8cd6c53d39264a59dacbcabe65b2b2c98
---

 modules/misc/webservices/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/misc/webservices/json.c b/modules/misc/webservices/json.c
index d34afdeab9..ae7044601d 100644
--- a/modules/misc/webservices/json.c
+++ b/modules/misc/webservices/json.c
@@ -372,7 +372,7 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
 
                case ']':
 
-                  if (top->type == json_array)
+                  if (top && top->type == json_array)
                      flags = (flags & ~ (flag_need_comma | flag_seek_value)) | flag_next;
                   else if (!(state.settings.settings & json_relaxed_commas))
                   {  sprintf (error, "%d:%d: Unexpected ]", cur_line, e_off);



More information about the vlc-commits mailing list