Bug 187605 - Crash when listing directory contents
Summary: Crash when listing directory contents
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ncftp
Version: 5
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Matthias Saou
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-01 17:08 UTC by Lauri Nurmi
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 3.1.9-4
Clone Of:
Environment:
Last Closed: 2006-05-12 11:23:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lauri Nurmi 2006-04-01 17:08:31 UTC
Description of problem:
ncftp crashes when locale is fi_FI.UTF-8 and trying to list the contents of a
remote directory (using 'dir'). The crash probably has something to do with
non-ASCII letters in month names.

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

How reproducible:
Every time, when the directory contains a file with a timestamp from a certain
month.

Steps to Reproduce:
1. Connect to a server, e.g. LC_ALL=fi_FI.UTF-8 ncftp ftp.funet.fi
2. say 'dir'
3. *crash*
  
Actual results:

Logged in to ftp.funet.fi.
ncftp / > dir
drwxr-xr-x                maalis 15 23:54   dev
drwxr-xr-x                maalis 29 23:11   index
drwxrwxr-x                maalis 29 22:16   pub
-rw-r--r--        19796   maalis 30 00:23   README
-rw-r--r--         5524   elo    24  2000   README.FILETYPES
-rw-r--r--         5120   marras 20  1996   README.UPLOADER
drwxr-xr-x                huhti   1 17:16   rfc
*** stack smashing detected ***: /usr/bin/ncftp terminated


With a version with debug symbols we can see a backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0013ec46 in vfprintf () from /lib/libc.so.6
(gdb) bt
#0  0x0013ec46 in vfprintf () from /lib/libc.so.6
#1  0x00144282 in fprintf () from /lib/libc.so.6
#2  0x080539d6 in LsL (dirp=0xbfad9548, endChars=0, linkedTo=0,
    stream=0x2304c0) at ls.c:390
#3  0x08054014 in Ls (item=0x0, listmode=108, options=0xbfad97f8 "",
    stream=0x2304c0) at ls.c:620
#4  0x0804d2a2 in ListCmd (argc=1, argv=0xbfad98d4, cmdp=0x80897e0,
    aip=0xbfad98d4) at cmds.c:1550
#5  0x08055670 in DoCommand (aip=0xbfad98d4) at shell.c:408
#6  0x08055a0d in CommandShell () at shell.c:582
#7  0x08054e59 in main (argc=2, argv=0xbfada9e4) at main.c:492


Expected results:
No crash.

Additional info:
I tested a few other locales besides fi_FI.UTF-8, but no crash with them.

Comment 1 Matthias Saou 2006-05-10 10:56:21 UTC
I've taken the time to reproduce the problem with an unpatched build of the
3.1.9 sources, and reported the problem upstream. Hopefully they will fix this
for the next release and provide a patch against 3.1.9 for now.

Comment 2 Matthias Saou 2006-05-12 11:23:36 UTC
Got a patch back from Mike Gleason which fixes the problem. New builds are done
and will appear shortly.


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