diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-21 03:14:01 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-21 03:14:01 +0800 |
commit | f8a342c350c3045a78be2fde1dad44c0d91fa7bf (patch) | |
tree | 64ebf0dadd4140ce62bb90902d1834e2ea33e3e4 | |
parent | c0ce9aa20d6ad6095c9a11d00bbd14d200a7ee4e (diff) |
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.
-rw-r--r-- | src/gsm_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm_utils.c b/src/gsm_utils.c index 1a7ba0e4..37b4df6a 100644 --- a/src/gsm_utils.c +++ b/src/gsm_utils.c @@ -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 */ |