]> git.tuebingen.mpg.de Git - paraslash.git/commit
wma_afh: Fix two bugs in convert_utf8_to_utf16().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 19:49:20 +0000 (21:49 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 20:57:37 +0000 (22:57 +0200)
commit1b9bf429a91f4c9fc1abc6030b02ca0c7739bca8
tree78f316a85e5060f71aa3f9cd2891b1d1dfc4f0f0
parentd193847d4086ce3d3a08d741cb0d93ded9353976
wma_afh: Fix two bugs in convert_utf8_to_utf16().

This function has two issues:

* If iconv_open() fails and src is NULL (or *src is NULL) we attempt
to close an invalid file descriptor.

* On errors, we free *dst but miss to set it to NULL, causing a double
free in the caller.

This patch addresses both issues. The double free was found by the
clang static analyzer.
wma_afh.c