remove possible overflow in capi_number()

This commit is contained in:
MelwareDE 2005-08-29 14:58:36 +00:00
parent 398aa1b09f
commit 2356a1f435
1 changed files with 2 additions and 2 deletions

View File

@ -697,8 +697,8 @@ static char *capi_number_func(unsigned char *data, unsigned int strip, char *buf
len = data[0];
data += 1;
}
if (len > AST_MAX_EXTENSION)
len = AST_MAX_EXTENSION;
if (len > (AST_MAX_EXTENSION - 1))
len = (AST_MAX_EXTENSION - 1);
/* convert a capi struct to a \0 terminated string */
if ((!len) || (len < strip))