Bug 74594

Summary: transfig fails with segmentation fault on ANY file
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: transfigAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.4-8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-19 07:38:51 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 Flags
patch adds #include <stdlib> to transfig.c and sys.c files none

Description Sysoltsev Slawa 2002-09-27 08:36:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
When I am trying to start transfig it fails with segmentation fault on any 
input file in parse_arg function (at line transfig.c:215).

Reason of fault is because you use malloc function implicitly without 
prototyping - gcc warns building package about it. Used implicitly, 'int' 
return type is assumed. As you may be know on IA64 'int' type is only 32bit 
width while pointers are 64bit width, so result from malloc is cutted to fit 32 
bit. As a result bad pointer is used and application crashes. Also such error
appears in sys.c (function mksuff).

Workaround is to add #include <stdlib> in begin transfig.c and sys.c source 
files. I'll attach patch fixing problem.
With it application becomes runnable.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. /usr/X11R6/bin/transfig SomeFile
	

Actual Results:  Message:
Segmentation fault (core dumped)

Expected Results:  Something more reliable

Additional info:

Comment 1 Sysoltsev Slawa 2002-09-27 08:43:09 UTC
Created attachment 77446 [details]
patch adds #include <stdlib> to transfig.c and sys.c files

Comment 2 Miloslav Trmač 2004-10-19 07:38:51 UTC
Fixed in transfig-3.2.4-8. Thanks for the patch.