Received: from eggs.gnu.org ([2001:4830:134:3::10]:34589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPBmD-00062h-7n for qemu-devel@nongnu.org; Tue, 20 Nov 2018 14:33:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPBle-0008TY-GX for qemu-devel@nongnu.org; Tue, 20 Nov 2018 14:33:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPBla-0008Kl-Dh for qemu-devel@nongnu.org; Tue, 20 Nov 2018 14:32:58 -0500 From: Markus Armbruster References: <20181119154737.9840-1-liq3ea@163.com> <20181119154737.9840-3-liq3ea@163.com> Date: Tue, 20 Nov 2018 20:32:47 +0100 In-Reply-To: <20181119154737.9840-3-liq3ea@163.com> (Li Qiang's message of "Mon, 19 Nov 2018 07:47:36 -0800") Message-ID: <87k1l78rz4.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/3] fw_cfg: fix -boot reboot-timeout error checking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Qiang Cc: pbonzini@redhat.com, kraxel@redhat.com, lersek@redhat.com, philmd@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org Li Qiang writes: > fw_cfg_reboot() gets option parameter "reboot-timeout" with > qemu_opt_get(), then converts it to an integer by hand. It neglects to > check that conversion for errors, and fails to reject negative values. > Positive values above the limit get reported and replaced by the limit. > This patch checks for conversion errors properly, and reject all valus Spelling: all values. > outside 0...0xffff. > > Signed-off-by: Li Qiang Reviewed-by: Markus Armbruster