trau_mux.c: Prevent out-of-bounds read in trau_decode_fr()
Haralds patch in 9f109dfb9926558b6ea504dc3aee92cfd64413bd only fixed
the trau_encode_fr part but the issue seems to exist in the decode
function as well. Apply the same fix.
diff --git a/openbsc/src/libtrau/trau_mux.c b/openbsc/src/libtrau/trau_mux.c
index 4f159e4..3831a80 100644
--- a/openbsc/src/libtrau/trau_mux.c
+++ b/openbsc/src/libtrau/trau_mux.c
@@ -235,6 +235,9 @@
o = 0; /* offset input bits */
while (i < 260) {
data[j/8] |= (tf->d_bits[k+o] << (7-(j%8)));
+ /* to avoid out-of-bounds access in gsm_fr_map[++l] */
+ if (i == 259)
+ break;
if (--k < 0) {
o += gsm_fr_map[l];
k = gsm_fr_map[++l]-1;