Bug 55900 - Unknown LC_ALL setting causes segmentation fault
Unknown LC_ALL setting causes segmentation fault
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: mpage (Show other bugs)
7.2
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-08 09:49 EST by scheck
Modified: 2014-03-16 22:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-11-08 09:49:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description scheck 2001-11-08 09:49:51 EST
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 12:02:03 EST
Fixed in 2.5.1-8.

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