mirror of https://gerrit.osmocom.org/libosmocore
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:
parent
c0ce9aa20d
commit
f8a342c350
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue