Package: capi4hylafax
Version: 1:01.03.00.99.svn.296
Severity: normal

*** Please type your report below this line ***

When reading an config file with empty lines c2faxrecv segfaults on
startup.

[EMAIL PROTECTED]:~/capi4hyla-01.03.00.99.svn.296-work-copy$ gdb --args 
faxrecv/c2faxrecv -C ~/work/capi4hylafax-01.03.00.99.svn.296/config.faxCAPI
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux"...Using host libthread_db library 
"/lib/libthread_db.so.1".

(gdb) run
Starting program: 
/home/glamus/capi4hyla-01.03.00.99.svn.296-work-copy/faxrecv/c2faxrecv -C 
/home/glamus/work/capi4hylafax-01.03.00.99.svn.296/config.faxCAPI
The config file is 
/home/glamus/work/capi4hylafax-01.03.00.99.svn.296/config.faxCAPI.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000409298 in CDynamicString::GetLastChar (this=0x7fbffff3d0) at 
CString.h:267
267         return pntr[GetLen() - 1];
(gdb) bt
#0  0x0000000000409298 in CDynamicString::GetLastChar (this=0x7fbffff3d0) at 
CString.h:267
#1  0x0000000000426d80 in CConfigFileParser::ParseFile (this=0x7fbffff650, 
FileHandle=0x53e200) at FilePars.cpp:70
#2  0x0000000000426c53 in CConfigFileParser::ParseFile (this=0x7fbffff650,
    FileName=0x7fbffffb7d 
"/home/glamus/work/capi4hylafax-01.03.00.99.svn.296/config.faxCAPI") at 
FilePars.cpp:38
#3  0x000000000040a267 in CFaxReceiveMain::Config (this=0x7fbffff730, 
CommandLineSpoolDir=0x0) at recvmain.cpp:221
#4  0x000000000040b42d in CFaxReceiveMain::main (this=0x7fbffff730, argc=3, 
argv=0x7fbffff968) at recvmain.cpp:607
#5  0x000000000040b4fa in main (argc=3, argv=0x7fbffff968) at recvmain.cpp:633
(gdb) up
#1  0x0000000000426d80 in CConfigFileParser::ParseFile (this=0x7fbffff650, 
FileHandle=0x53e200) at FilePars.cpp:70
70                          } while ( (curLine.GetLastChar() == '\r')
(gdb) print curLine
$1 = {<CConstString> = {_vptr.CConstString = 0x42dab0, pntr = 0x53e440 "", 
curLen = 0, maxSize = 100,
    detectError = false}, <No data fields>}
(gdb) print szPartLine
$4 = "\n\000\000DIT THIS CONFIGURATION TO REFLECT YOUR 
SETUP\n\000�\000\000\000\000\000\b\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000�225*\000\000\000\026\000\000\000\000\000\000\000�\225*\000\000\000\006\225*",
 '\0' <repeats 27 times>, 
"}\177\000\000\000\000�\000\000\000\000\000\221�\000\000\000\000\000}\177", 
'\0' <repeats 19 times>, 
"\001\000\000\000\000\000\000\000\217:\225*\000\000\000�\177\000\000\000"
(gdb) q

When using this patch this no longer happens:

--- capi4hylafax-01.03.00.99.svn.296.orig/src/standard/FilePars.cpp
+++ capi4hylafax-01.03.00.99.svn.296/src/standard/FilePars.cpp
                 case '\n':
                     do {
                         curLine.CutLen (1);
-                    } while (  (curLine.GetLastChar() == '\r')
-                            || (curLine.GetLastChar() == '\n'));
+                    } while ( curLine.GetLen() &&
+                             (  (curLine.GetLastChar() == '\r')
+                                || (curLine.GetLastChar() == '\n')));
                     dprint ("ParseLine=(%s)\n", curLine.GetPointer());
                     fret = ParseLine (&curLine);
                     switch (fret) {


-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.8-11-amd64-generic
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages capi4hylafax depends on:
ii  capiutils             1:3.6.2005-01-03-5 Utilities for CAPI-capable ISDN ca
ii  libc6                 2.3.2.ds1-22       GNU C Library: Shared libraries an
ii  libcapi20-2           1:3.6.2005-01-03-5 libraries for CAPI support
ii  libgcc1               1:3.4.3-13         GCC support library
ii  libstdc++6            3.4.3-13           The GNU Standard C++ Library v3
ii  libtiff4              3.7.2-3            Tag Image File Format (TIFF) libra
ii  zlib1g                1:1.2.2-4.sarge.2  compression library - runtime

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to