]> git.sesse.net Git - vlc/commitdiff
Fix NULL pointer deferences (CID 120 & 121)
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 30 May 2008 15:56:42 +0000 (18:56 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 30 May 2008 15:56:50 +0000 (18:56 +0300)
src/network/httpd.c

index 6ddd9dab8de4f4a7cb13bb01fbb34ca0476d490a..b5cca189c2ddc570c34f33b6d7ea04e7e318d17c 100644 (file)
@@ -394,7 +394,6 @@ httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
                     httpd_message_t *answer, const httpd_message_t *query )
 {
     httpd_file_t *file = (httpd_file_t*)p_sys;
-    uint8_t *psz_args = query->psz_args;
     uint8_t **pp_body, *p_body;
     const char *psz_connection;
     int *pi_body, i_body;
@@ -431,6 +430,7 @@ httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
         /* msg_Warn not supported */
     }
 
+    uint8_t *psz_args = query->psz_args;
     file->pf_fill( file->p_sys, file, psz_args, pp_body, pi_body );
 
     if( query->i_type == HTTPD_MSG_HEAD && p_body != NULL )
@@ -520,7 +520,6 @@ httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
                        httpd_message_t *answer, const httpd_message_t *query )
 {
     httpd_handler_t *handler = (httpd_handler_t*)p_sys;
-    uint8_t *psz_args = query->psz_args;
     char psz_remote_addr[NI_MAXNUMERICHOST];
 
     if( answer == NULL || query == NULL )
@@ -536,6 +535,7 @@ httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
     if( httpd_ClientIP( cl, psz_remote_addr ) == NULL )
         *psz_remote_addr = '\0';
 
+    uint8_t *psz_args = query->psz_args;
     handler->pf_fill( handler->p_sys, handler, query->psz_url, psz_args,
                       query->i_type, query->p_body, query->i_body,
                       psz_remote_addr, NULL,