Package: bc
Version: 1.06-19
Severity: normal
Running "bc -l" on the following bc script causes a segfault
=== Example script starts on next line ===
define a(){}
define b(){}
define c(){}
define d(){}
define e(){}
define f(){t()}
define g(){cot(p())}
define h(){a()}
define i(){a()}
define j(){aa()}
define k(){n()}
define ln(n){}
define m(){}
define lcm(){ac()ab()}
define ad() {fl()}
lg()
l(x)/l(2)
pw()
ep(5)
=== Example script ends on previous line ===
When running, bc gives the following output (I saved the above script
as bccrash, and ran "bc -l bccrash"):
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
bccrash 14: parse error
Runtime error (func=(main), adr=2): Function lg not defined.
-144269504088896340736.05504438629162572417
Runtime error (func=(main), adr=2): Function pw not defined.
Runtime error (func=(main), adr=5): Segmentation fault
Running "valgrind bc -l bccrash" gives some additional information:
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
.../bccrash 14: parse error
Runtime error (func=(main), adr=2): Function lg not defined.
-144269504088896340736.05504438629162572417
Runtime error (func=(main), adr=2): Function pw not defined.
==563== Invalid write of size 4
==563== at 0x804F257: lookup (util.c:598)
==563== by 0x80499EB: yyparse (bc.y:558)
==563== by 0x804918D: main (main.c:262)
==563== Address 0x4169490 is 0 bytes after a block of size 128 alloc'd
==563== at 0x401B422: malloc (vg_replace_malloc.c:149)
==563== by 0x804EDD1: bc_malloc (util.c:698)
==563== by 0x804D724: more_functions (storage.c:88)
==563== by 0x804D832: init_storage (storage.c:44)
==563== by 0x8049143: main (main.c:224)
Runtime error (func=(main), adr=5): ==563==
==563== Conditional jump or move depends on uninitialised value(s)
==563== at 0x406EFAC: vfprintf (in /lib/tls/libc-2.3.5.so)
==563== by 0x406DC59: (within /lib/tls/libc-2.3.5.so)
==563== by 0x406DF1D: vfprintf (in /lib/tls/libc-2.3.5.so)
==563== by 0x804F5B4: rt_error (util.c:833)
==563== by 0x804C52C: execute (execute.c:152)
==563== by 0x804E9CD: run_code (util.c:296)
==563== by 0x80496D4: yyparse (bc.y:119)
==563== by 0x804918D: main (main.c:262)
Function (null) not defined.
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages bc depends on:
ii libc6 2.3.5-13 GNU C Library: Shared libraries an
ii libncurses5 5.5-1 Shared libraries for terminal hand
ii libreadline5 5.1-5 GNU readline and history libraries
bc recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]