Merge branch 'maint'
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 28 Jul 2017 08:03:34 +0000 (10:03 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 28 Jul 2017 08:03:34 +0000 (10:03 +0200)
A fix for an old bug which should be propagated to master and next.

* maint:
  vss: Avoid use after free in vss_send().

vss.c

diff --git a/vss.c b/vss.c
index 3632cf5..4a1db40 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -1046,9 +1046,9 @@ static void vss_send(struct vss_task *vsst)
                        continue;
                PARA_DEBUG_LOG("sending %u:%u (%u bytes)\n", fc->group.num,
                        fc->current_slice_num, fc->group.slice_bytes);
+               fc->current_slice_num++;
                fc->fcp->send_fec(fc->sc, (char *)fc->enc_buf,
                        fc->group.slice_bytes + FEC_HEADER_SIZE);
-               fc->current_slice_num++;
                fec_active = 1;
        }
        if (mmd->current_chunk >= mmd->afd.afhi.chunks_total) { /* eof */