aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2014-06-27 17:05:48 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-07 19:17:54 +0200
commit46d13268b89c4b5873bbdd5c1a8d81faa364fee5 (patch)
treec2a02c71226cc37894a99ad58976c10690311150
parent8a485f0becca7bbcd2a34de9d0dfd88ce8fcecaf (diff)
gprs_llc: Prevent llme_alloc/lle_init from reading invalid memory
Make the llc_default_params structure from which data is initialized large enough. Otherwise address sanitizer complains with out-of-bounds reads. Only SAPIs 1, 2, 3, 5, 7, 8, 9, 11 are defined for GPRS but the struct gprs_llc_llme includes NUM_SAPIS lle's and they are populated from the llc_default_params structure.
-rw-r--r--openbsc/src/gprs/gprs_llc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 70fe9dd04..e6b1f07da 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -84,7 +84,7 @@ static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
/* Section 8.9.9 LLC layer parameter default values */
-static const struct gprs_llc_params llc_default_params[] = {
+static const struct gprs_llc_params llc_default_params[NUM_SAPIS] = {
[1] = {
.t200_201 = 5,
.n200 = 3,