1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Description: fix \v(dialmessage)
Stop segfault on \v(dialmessage) when dialsta is uninitialised.
Forwarded: email
Author: Mark Wooding <mdw@distorted.org.uk>
Last-Update: 2012-05-09
Bug-Debian: http://bugs.debian.org/660276
Index: ckermit/ckuus4.c
===================================================================
--- ckermit.orig/ckuus4.c 2012-05-09 02:16:15.000000000 +0100
+++ ckermit/ckuus4.c 2012-05-09 02:16:48.000000000 +0100
@@ -12681,7 +12681,9 @@
#ifndef NODIAL
case VN_DMSG:
#ifdef BIGBUFOK
- ckstrncpy(vvbuf,dialmsg[dialsta],VVBUFL); /* Safe if src == NULL */
+ ckstrncpy(vvbuf,
+ ((dialsta < 0) ? "(none)" : dialmsg[dialsta]),
+ VVBUFL); /* Safe if src == NULL */
#endif /* BIGBUFOK */
return((char *)vvbuf);
#endif /* NODIAL */
|