]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
vss: Fix NULL pointer dereference in vss_del_fec_client().
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 19 Jul 2020 16:35:44 +0000 (18:35 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 19 Jul 2020 16:35:44 +0000 (18:35 +0200)
fc->src_data may well be NULL here, for example if para_server is
not currently playing.

This bug was introduced in the previous commit after the topic branch
had been promoted to next.

vss.c

diff --git a/vss.c b/vss.c
index 737b77ac29e546fcdbf808dbd884e5dcf5b291e5..9857d92dcd7e0e32721aaca15a86fc27fc061292 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -689,9 +689,11 @@ void vss_del_fec_client(struct fec_client *fc)
 
        list_del(&fc->node);
        free(fc->enc_buf);
-       for (i = 0; i < fc_num_data_slices(fc); i++)
-               free(fc->src_data[i]);
-       free(fc->src_data);
+       if (fc->src_data) {
+               for (i = 0; i < fc_num_data_slices(fc); i++)
+                       free(fc->src_data[i]);
+               free(fc->src_data);
+       }
        fec_free(fc->parms);
        free(fc);
 }