Bug 55900 - Unknown LC_ALL setting causes segmentation fault
Summary: Unknown LC_ALL setting causes segmentation fault
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mpage
Version: 7.2
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-08 14:49 UTC by scheck
Modified: 2014-03-17 02:24 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-11-08 14:49:56 UTC
Embargoed:


Attachments (Terms of Use)

Description scheck 2001-11-08 14:49:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:0.9.5) Gecko/20011011

Description of problem:
Some users (e.g. sybase) have LC_ALL set to default. If this locale is not
available on the system (locale -a) the programm crashes.

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


How reproducible:
Always

Steps to Reproduce:
1. echo "123" | LC_ALL=default mpage
2. Segmentation fault (core dumped)
3.
	

Actual Results:  [...]
288 80 mp_a_x mul div 378 792 div scale
4 7 translate 280 288 div 784 792 div scale
textfont setfont
Segmentation fault (core dumped)


Expected Results:  no segmentation fault ;-)

[...]
grestore
restore
showpage
%%Trailer
%%Pages: 1


Additional info:

mpage251-j-fix.patch causes this bug:

current_locale = setlocale(LC_ALL,"");
[...] 
if (!strncmp(current_locale,"ja_JP",5)) {

man setlocale:
If locale is NULL, the current locale is only queried, not modified.
The return value is NULL if the request cannot be honored.

=> check for NULL value before calling strncmp!!!

Comment 1 Bill Nottingham 2001-11-08 17:02:03 UTC
Fixed in 2.5.1-8.


Note You need to log in before you can comment on or make changes to this bug.