Fix NULL pointer in KEYPAD structure.

This commit is contained in:
MelwareDE 2007-09-20 13:15:27 +00:00
parent 4474fba4a3
commit 0423263179
2 changed files with 9 additions and 2 deletions

View File

@ -3398,7 +3398,7 @@ static void capidev_handle_connect_indication(_cmsg *CMSG, unsigned int PLCI, un
struct capi_pvt *i;
char *DNID;
char *CID;
char *KEYPAD;
char *KEYPAD = NULL;
int callernplan = 0, callednplan = 0;
int controller = 0;
char *msn;
@ -3420,7 +3420,9 @@ static void capidev_handle_connect_indication(_cmsg *CMSG, unsigned int PLCI, un
return;
}
KEYPAD = capi_number(CONNECT_IND_KEYPADFACILITY(CMSG), 0);
if (CONNECT_IND_KEYPADFACILITY(CMSG)) {
KEYPAD = capi_number(CONNECT_IND_KEYPADFACILITY(CMSG), 0);
}
DNID = capi_number(CONNECT_IND_CALLEDPARTYNUMBER(CMSG), 1);
if (!DNID) {
if (!KEYPAD) {

View File

@ -934,6 +934,11 @@ char *capi_number_func(unsigned char *data, unsigned int strip, char *buf)
{
unsigned int len;
if (data == NULL) {
buf[0] = '\0';
return buf;
}
if (data[0] == 0xff) {
len = read_capi_word(&data[1]);
data += 2;