Bug 157110
| Summary: | bmptopnm does not convert valid bitmaps -- reports error instead and segfaults | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | David Costanzo <david_costanzo> | ||||||
| Component: | netpbm | Assignee: | Jindrich Novy <jnovy> | ||||||
| Status: | CLOSED RAWHIDE | QA Contact: | Ben Levenson <benl> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 4 | CC: | pknirsch | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | i686 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 10.27-2 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2005-05-09 10:27:24 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
David Costanzo
2005-05-06 21:45:08 UTC
Created attachment 114103 [details]
24bpp-320x240.bmp -- a valid bitmap
This is the bitmap that I used to reproduce the bug. Any valid bitmap should
do.
Created attachment 114106 [details]
Proposed fix
The problem is more severe than I thought. The bug is in pm_readlittleshort()
and pm_readlittlelong(), which are called by many other programs within the
toolkit (not just bmptopbm). The bug is that pm_readlittlelong() only called
getch() twice and pm_readlittleshort() only called getch() once.
I checked that similar bugs are NOT present in the big-endian version of these
functions.
Hello David, the high severity is pretty suitable for this as bmptopnm doesn't work at all in certain cases. I found a memory corruption in the code where it segfaults because bmptopnm uses uinitialized pointer for colormaps what it tries to free() at the end in case BMPheader.cmapsize == 0. Fixed & rebuilt. |