bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] potentially uninitialized variable in rl_generic_bind


From: Adam Richter
Subject: [Patch] potentially uninitialized variable in rl_generic_bind
Date: Fri, 24 May 2019 01:14:06 -0700

cppcheck noticed that, in the file lib/readline/bind.c, the function
rl_generic_bind contains a loop that declares a variable named ic in
the loop body, and relies on that variable being initialized with its
value from the previous iteration (in the line "prevkey = ic;"), which
is not something that the compiler guarantees.  This patch lifts the
declaration of ic outside the loop to ensure that its value is
preserved across those iterations.

The file produced by running "strip" on the resulting bind.o file is
unchanged by this patch on the x86_64 and i686 configurations that I
tried.

I have not signed an FSF copyright assignment, but I hereby release my
copyright interest in this trivial change to the public domain.  I
hope that suffices, but please let me know if that is not the case.

Thanks in advance for considering this patch submission.

Adam

Attachment: bash-5.0.bind.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]