Created attachment 25730 [details] [review]
Don't crash in write_match when magic->matches is NULL.
A empty <magic/> element causes update-mime-database to crash, like this example:
The attached patch fixes that.
This is with shared-mime-info 0.30, forgot to say.
The latest version is 0.60, and it's even newer in CVS. Could you check whether that's still needed?
(In reply to comment #2)
> The latest version is 0.60, and it's even newer in CVS. Could you check whether
> that's still needed?
From reading the code, it is still needed in 0.60 and CVS.
(I.e., write_match still access match->magic whithout checking whether it is NULL, but I didn't check whether there is some other change that makes sure write_match never sees a NULL.)
Already fixed as part of bug 28527, along with a test case.
*** This bug has been marked as a duplicate of bug 28527 ***