Problem: use-after-free in popup_getoptions() on dict_add() failure
Solution: Set b to NULL (Yasuhiro Matsumoto).
When dict_add() failed, dictitem_free() unref'd and freed the blob, but
the error cleanup then read the freed blob's refcount and could free it
again. Clear the pointer after dictitem_free().
closes: #20464
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
++b->bv_refcount;
if (dict_add(idict, item) == FAIL)
{
+ // dictitem_free() already freed the blob
dictitem_free(item);
+ b = NULL;
ok = FALSE;
}
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 618,
/**/
617,
/**/