File: 030_fix_dialmessage.patch

package info (click to toggle)
ckermit 302-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,964 kB
  • sloc: ansic: 273,844; makefile: 10,035; sh: 66
file content (22 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (3)
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 */