From 17fb3d46ffcf48685943cc9dd4a2e80700f4fa64 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 5 Jan 2015 09:43:51 +0100 Subject: 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 --- openbsc/src/gprs/sgsn_vty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openbsc/src/gprs/sgsn_vty.c') diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 9b925a8cb..b15de75c7 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -521,15 +521,15 @@ DEFUN(update_subscr_insert_auth_triplet, update_subscr_insert_auth_triplet_cmd, 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; } -- cgit v1.2.3