mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 03:02:37 +02:00
Merge bitcoin/bitcoin#34597: util: Fix UB in SetStdinEcho when ENOTTY
fa6af85634refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning (MarcoFalke)fa692974acutil: Fix UB in SetStdinEcho when ENOTTY (MarcoFalke) Pull request description: The call to `tcgetattr` may fail with `ENOTTY`, leaving the struct possibly uninitialized (UB). Fix this UB by returning early when `isatty` fails, or when `tcgetattr` fails. (Same for Windows) This can be tested by a command that fails valgrind before the change and passes after: ``` echo 'pipe' | valgrind --quiet ./bld-cmake/bin/bitcoin-cli -stdinrpcpass uptime ACKs for top commit: achow101: ACKfa6af85634l0rinc: lightly tested code review ACKfa6af85634sedited: ACKfa6af85634Tree-SHA512: 76e2fbcb6c323b17736ee057dbd5e932b2e8cbb7d9fe4488c1dc7ab6ea928a3cde7e72ca0a63f8c8c78871ccb8b669263b712c0e1b530d88f2d45ea41f071201
This commit is contained in:
@@ -14,12 +14,6 @@
|
||||
# Note that suppressions may depend on OS and/or library versions.
|
||||
# Tested on aarch64 and x86_64 with Ubuntu Noble system libs, using clang-16
|
||||
# and GCC, without gui.
|
||||
{
|
||||
Suppress uninitialized bytes warning in compat code
|
||||
Memcheck:Param
|
||||
ioctl(TCSET{S,SW,SF})
|
||||
fun:tcsetattr
|
||||
}
|
||||
{
|
||||
Suppress leaks on shutdown
|
||||
Memcheck:Leak
|
||||
|
||||
Reference in New Issue
Block a user