Bug 21679 - update-mime-database should handle empty magic elements
Summary: update-mime-database should handle empty magic elements
Status: RESOLVED DUPLICATE of bug 28527
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Shared Mime Info group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-11 07:34 UTC by Marius Vollmer
Modified: 2010-12-01 09:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Don't crash in write_match when magic->matches is NULL. (448 bytes, patch)
2009-05-11 07:34 UTC, Marius Vollmer
Details | Splinter Review

Description Marius Vollmer 2009-05-11 07:34:22 UTC
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:

<mime-type type="video/quicktime"> 
  <comment>QuickTime video</comment> 
  <magic priority="50"> 
  </magic> 
  <glob pattern="*.mov"/> 
</mime-type> 

The attached patch fixes that.
Comment 1 Marius Vollmer 2009-05-11 07:35:43 UTC
This is with shared-mime-info 0.30, forgot to say.
Comment 2 Bastien Nocera 2009-05-11 08:06:13 UTC
The latest version is 0.60, and it's even newer in CVS. Could you check whether that's still needed?
Comment 3 Marius Vollmer 2009-05-11 09:05:24 UTC
(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.)
Comment 4 Bastien Nocera 2010-12-01 09:15:33 UTC
Already fixed as part of bug 28527, along with a test case.

*** This bug has been marked as a duplicate of bug 28527 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.