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