]> git.tuebingen.mpg.de Git - paraslash.git/commit - vss.c
vss: Propagate return value of afh_get_chunk().
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 6 Aug 2017 12:21:15 +0000 (14:21 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 22 Sep 2017 14:38:50 +0000 (16:38 +0200)
commit21859dc53e11f56e76a5db0f105ee65a20d09ab9
treed6693b2efd522286bb97fc85c7499c6413b4c21e
parent75b85153a5bd0fee7feae5c20ba5928715d0cffb
vss: Propagate return value of afh_get_chunk().

With dynamic chunks, afh_get_chunk() may fail. Currently
vss_get_chunk() prints an error message in this case and returns
the null pointer. However, some callers of vss_get_chunk() happily
dereference the returned pointer without checking for NULL.

This patch modifies vss_get_chunk() to return int and teaches all
callers to check the return value. For the udp and dccp transport,
we disable the fec client temporarily in the error case while for
the http transport we log the error (but otherwise ignore it), and
try to continue with the next chunk.

This flaw was noticed by the clang static analyzer.
vss.c