aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-14 19:24:06 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-14 19:24:06 +0800
commit023ac9337739a7937757d6cbc7f234eba655d4f6 (patch)
treed65f3801630ba067c0ee22667b89fca5a5cf3e11
parentfa53aba62c4c56ec45aa98029744b74971ac9cdd (diff)
[nat] Fix the size check of the LU Request.
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index dbff1ab3e..c987b69bc 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -200,8 +200,9 @@ static int _cr_check_loc_upd(struct bsc_connection *bsc, uint8_t *data, unsigned
struct gsm48_loc_upd_req *lu;
char mi_string[GSM48_MI_SIZE];
- if (sizeof(*lu) < length) {
- LOGP(DNAT, LOGL_ERROR, "Location updating request does not fit.\n");
+ if (length < sizeof(*lu)) {
+ LOGP(DNAT, LOGL_ERROR,
+ "LU does not fit. Length is %d \n", length);
return -1;
}