Commit 57f0df3e authored by David Brown's avatar David Brown Committed by David Brown
Browse files

boot_serial: Initialize possibly initialized variable

The variable `dec_off` can possibly be uninitialized in this function.
As long as the serial protocol used is formed correctly, the
initialization will always happen.  Place an initialization upon
function entry to protect against a case where a malformed protocol is
able to provoke this variable being used before being initialized.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 4cb70ccb
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/boot_serial/src/boot_serial.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -583,7 +583,7 @@ boot_serial_start(const struct boot_uart_funcs *f)
{
    int rc;
    int off;
    int dec_off;
    int dec_off = 0;
    int full_line;
    int max_input;