From patchwork Fri Mar 16 14:39:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nia Alarie X-Patchwork-Id: 10287631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CA8760386 for ; Fri, 16 Mar 2018 14:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F68428F3C for ; Fri, 16 Mar 2018 14:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 531BF28F40; Fri, 16 Mar 2018 14:40:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BFCCF28F3C for ; Fri, 16 Mar 2018 14:40:34 +0000 (UTC) Received: from localhost ([::1]:57494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewqX3-0003cy-82 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Mar 2018 10:40:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewqWE-0002uV-7X for qemu-devel@nongnu.org; Fri, 16 Mar 2018 10:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewqWA-0006L1-BC for qemu-devel@nongnu.org; Fri, 16 Mar 2018 10:39:42 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:50190) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewqWA-0006Kj-51 for qemu-devel@nongnu.org; Fri, 16 Mar 2018 10:39:38 -0400 Received: by mail-wm0-x243.google.com with SMTP id w128so3492278wmw.0 for ; Fri, 16 Mar 2018 07:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tbAAl3iMqtv5pjEnyo/pGmzeoLQkKbN841nafRZBZOE=; b=UXFC3T75ftULi0FJrA6f/t0SV2zQVowUHJL4Og+CmNCbEQJJmxNhihxUI18V4O+gLW gotAf5+pFR36e5FIKcqP2p5u7FleMdZ8eltq7n+fhEyK/lTb3XaLBqJxnDkujtDhRzSf RBkOQirjZuprkMBwthoIXGiiG9lgX+fwsZGWptaten2WyH1VtWBzVsGdesZjz9r6ZDjT WYyrpDhB930OveNArm4sMFzuY7zbzRV9/oa91MsozwYB6mMjT3VADVk7759YovjSAqgj 3Hp53yCEwpzOZGwhkBvTo2wolqoVbq6qfoxYUa6uUf2iQ6ut9nJWjnJR6W6gBAH30Rfb 5t5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tbAAl3iMqtv5pjEnyo/pGmzeoLQkKbN841nafRZBZOE=; b=C+6tTF6VFn/yE8B6OfkvHJnZuCDj4rL3+GitfYanXa/KunCIupuBrNE9MPoYVb9FTI i432omz4F2xDQ9oOtLb5j8KglnrH35KItkEi2bIqhmg1wM7bhtFhEVESiPxHHRrebrVa M5tF+forqW3nfoMYkAG/I+P4mCP2IK2IxOHXLhpY8shV1N6+KcWm4HqrpZIKcdOR1rJD tWxL1s8RKUMDVe1ZIEMsTrqNldUnDDNNyIB+pHtZ0e73NZCl1ZniETocATdoz8k/PX9C gvceZaISRQv6lK5vZza/1Fm7AdBF/9igf++JhDbopV7dl/sSbB176utYJREhA0W++L3D A43Q== X-Gm-Message-State: AElRT7FwSUhXSx4r0dSaIuMOfpxOMW5EK0LIGrmn4CITLlCWVsR/JKqE HdQI7Gosu/StOpeH7E4rfOOj0A== X-Google-Smtp-Source: AG47ELssoDE/BMVVpCFKaTfNyYBlVA7v1l0T0qP0dp2iB/1btqPK4iI86iSypikrlJOM3biw2mzRBw== X-Received: by 10.80.192.75 with SMTP id u11mr1590497edd.16.1521211176408; Fri, 16 Mar 2018 07:39:36 -0700 (PDT) Received: from localhost.localdomain ([185.222.219.238]) by smtp.gmail.com with ESMTPSA id j55sm4184423ede.14.2018.03.16.07.39.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 07:39:35 -0700 (PDT) From: Nia Alarie To: qemu-devel@nongnu.org Date: Fri, 16 Mar 2018 14:39:21 +0000 Message-Id: <20180316143921.30780-1-nia.alarie@gmail.com> X-Mailer: git-send-email 2.16.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH] net/slirp: Convert atoi to qemu_strtoi to allow error checking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jim@groklearning.com, stefanha@gmail.com, jasowang@redhat.com, Nia Alarie , joel@jms.id.au, jan.kiszka@siemens.com, samuel.thibault@ens-lyon.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nia Alarie --- net/slirp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index 8991816bbf..e938944bd4 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -486,7 +486,9 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict) goto fail_syntax; } - host_port = atoi(p); + if (qemu_strtoi(p, NULL, 10, &host_port)) { + goto fail_syntax; + } err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);