fw_cfg: Fix -boot reboot-timeout error checking
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 values outside 0...0xffff. Signed-off-by: NLi Qiang <liq3ea@gmail.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NGerd Hoffmann <kraxel@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1542777026-2788-3-git-send-email-liq3ea@gmail.com> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Showing
想要评论请 注册 或 登录