From 49b83935368d76f27c38560f326d9b251847554c Mon Sep 17 00:00:00 2001 From: Michael Tuexen <tuexen@fh-muenster.de> Date: Sat, 7 Oct 2017 15:54:07 +0200 Subject: [PATCH] Fix CID 187665. --- gtests/net/packetdrill/run_system_call.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index 55a3fba1..cd60052f 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -3905,10 +3905,12 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, return STATUS_ERR; switch (val_expression->type) { case EXPR_LINGER: - get_s32(val_expression->value.linger->l_onoff, - &linger.l_onoff, error); - get_s32(val_expression->value.linger->l_linger, - &linger.l_linger, error); + if (get_s32(val_expression->value.linger->l_onoff, + &linger.l_onoff, error)) + return STATUS_ERR; + if (get_s32(val_expression->value.linger->l_linger, + &linger.l_linger, error)) + return STATUS_ERR; optval = &linger; if (!optlen_provided) { optlen = (socklen_t)sizeof(struct linger); -- GitLab