projects
/
osmocom-bb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31e97ea
)
gsm_7bit_decode: Handle the case of the last charachter being an escape
author
Holger Hans Peter Freyther
<zecke@selfish.org>
Mon, 19 Jul 2010 18:54:54 +0000
(
02:54
+0800)
committer
Holger Hans Peter Freyther
<zecke@selfish.org>
Mon, 19 Jul 2010 18:54:54 +0000
(
02:54
+0800)
If i + 1 == length and it is an escape charachter we would try
to read rtext[length] which is one after the field we have allocated.
src/gsm_utils.c
patch
|
blob
|
history
diff --git
a/src/gsm_utils.c
b/src/gsm_utils.c
index
fb69377
..
3a378ac
100644
(file)
--- a/
src/gsm_utils.c
+++ b/
src/gsm_utils.c
@@
-65,7
+65,7
@@
int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t length)
}
for(i = 0; i < length; i++){
/* this is an extension character */
- if(rtext[i] == 0x1b){
+ if(rtext[i] == 0x1b
&& i + 1 < length
){
tmp = rtext[i+1];
*(text++) = gsm_7bit_alphabet[0x7f + tmp];
i++;