gsm_7bit_decode: rtext does not hold a null byte, reduce the size

I have added the + 1 as I thought rtext will hold a terminating
null byte but it will not.
This commit is contained in:
Holger Hans Peter Freyther 2010-07-21 03:14:01 +08:00
parent c0ce9aa20d
commit f8a342c350
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t length)
int i = 0;
int l = 0;
int septet_l = (length * 8) / 7;
uint8_t *rtext = calloc(septet_l + 1, sizeof(uint8_t));
uint8_t *rtext = calloc(septet_l, sizeof(uint8_t));
uint8_t tmp;
/* FIXME: We need to account for user data headers here */