sgsn: Fix VTY command error handling (Coverity)
Currently the result of the osmo_hexparse function in
update_subscr_insert_auth_triplet is not handled correctly. There is
a misplaced leading exclamation mark in a few conditional
expressions. This effectively disables the error checks, as it is
noticed by Coverity ("Missing parentheses" followed by "Logically
dead code").
This patch removes the exclamation marks.
Fixes: Coverity CID 1260435 and CID 1260434
Sponsored-by: On-Waves ehf
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 9b925a8..b15de75 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -521,15 +521,15 @@
OSMO_ASSERT(subscr->sgsn_data);
- if (!osmo_hexparse(sres_str, &at.sres[0], sizeof(at.sres)) < 0) {
+ if (osmo_hexparse(sres_str, &at.sres[0], sizeof(at.sres)) < 0) {
vty_out(vty, "%% invalid SRES value '%s'\n", sres_str);
goto failed;
}
- if (!osmo_hexparse(rand_str, &at.rand[0], sizeof(at.rand)) < 0) {
+ if (osmo_hexparse(rand_str, &at.rand[0], sizeof(at.rand)) < 0) {
vty_out(vty, "%% invalid RAND value '%s'\n", rand_str);
goto failed;
}
- if (!osmo_hexparse(kc_str, &at.kc[0], sizeof(at.kc)) < 0) {
+ if (osmo_hexparse(kc_str, &at.kc[0], sizeof(at.kc)) < 0) {
vty_out(vty, "%% invalid Kc value '%s'\n", kc_str);
goto failed;
}