Article View: gnu.utils.bug
Article #789imageto dumps core with untyped input filename
From: peter c halverson
Date: Thu, 10 Sep 1992 21:49
Date: Thu, 10 Sep 1992 21:49
24 lines
1190 bytes
1190 bytes
Problem Description:
Assuming an IMG input file with the name "gbbb.img", imageto dumps core
with a segmentation fault given the arguments:
% imageto gbbb
(e.g. accidently omitting the ".img" extension).
Cursory investigation reveals that in the routine "set_input_format" in
"imageto/main.c" is not checking for a NULL return value from "find_suffix"
before doing STREQ comparisons on the result.
Suggested fix:
imageto/main.c:
998c998
< if (STREQ (input_extension, "img"))
---
> if (input_extension && STREQ (input_extension, "img"))
1001c1001
< else if (STREQ (input_extension, "pbm"))
---
> else if (input_extension && STREQ (input_extension, "pbm"))
Technical Details
Message-ID:
<9209102149.AA25283@sol.crd.Ge.Com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sol.CRd.ge.COM!halversShow Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sol.CRd.ge.COM!halvers From: halvers@sol.CRd.ge.COM (peter c halverson) Subject: imageto dumps core with untyped input filename Message-ID: <9209102149.AA25283@sol.crd.Ge.Com> Sender: gnulists@ai.mit.edu Reply-To: Pete Halverson <halverson@crd.ge.com> Organization: GNUs Not Usenet Distribution: gnu Date: Thu, 10 Sep 1992 21:49:31 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 26