Bug 42556

Summary: xfig coredumps if .xfigrc contains newline in filenames
Product: [Retired] Red Hat Linux Reporter: santini
Component: xfigAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-28 09:58:56 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:

Description santini 2001-05-28 09:58:52 UTC
Description of problem:
My xfig crashed at startup. A strace reveals that it happend while 
reading .xfigrc. Deleting it makes xfig run with no problem.

My .xifgrc contained:

file: /home/santini/
test

(yes, a newline in the middle of the filename). With such a .xfigrc (or
similar, with a newline in a filename) causes xfig to coredump. These are
the last straced lines:

open("/home/santini/.xfigrc", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0640, st_size=23, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40018000
read(4, "file: /home/user/\ntest\n", 4096) = 23
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++


How reproducible:
Always

Steps to Reproduce:
1. Put 

file: something
andnewline

in .xfigrc

2. launch xfig
	

Actual Results:  The program core dupms instead of running.

Expected Results:  Just run...

Additional info:

Removing the .xfigrc (or simply removing filenames with newline in them)
solves the problem.

These are the last straced line of a crash:

open("/home/santini/.xfigrc", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0640, st_size=16, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40018000
read(4, "file: something\nandnewline\n", 4096)     = 16
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Comment 1 Ngo Than 2001-05-29 16:33:36 UTC
It's fixed in xfig-3.2.3d-0.1.You will find it later in rawhide.