aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-10-12 10:53:41 +0100
committerRon Yorston <rmy@pobox.com>2022-10-12 10:53:41 +0100
commit86ea6f748ee1e6559c674efdec436e86e608753a (patch)
tree8adeac4f7df47ee969b69f9c23bbdef2feaa3c10
parent0f3cc2e721372a4efe3e1fe71c0d4fe67cfd3d90 (diff)
downloadbusybox-w32-86ea6f748ee1e6559c674efdec436e86e608753a.tar.gz
busybox-w32-86ea6f748ee1e6559c674efdec436e86e608753a.tar.bz2
busybox-w32-86ea6f748ee1e6559c674efdec436e86e608753a.zip
xxd: avoid use of uninitialised variable
If xxd is run with '-r' but no '-s' the value of opt_s passed to reverse() is uninitialised. This patch has been submitted upstream but hasn't been applied yet.
-rw-r--r--util-linux/hexdump_xxd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c
index 6629407de..9173f5d43 100644
--- a/util-linux/hexdump_xxd.c
+++ b/util-linux/hexdump_xxd.c
@@ -229,7 +229,11 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
229{ 229{
230 char buf[80]; 230 char buf[80];
231 dumper_t *dumper; 231 dumper_t *dumper;
232#if !ENABLE_PLATFORM_MINGW32
232 char *opt_l, *opt_s, *opt_o; 233 char *opt_l, *opt_s, *opt_o;
234#else
235 char *opt_l, *opt_s = NULL, *opt_o;
236#endif
233 unsigned bytes = 2; 237 unsigned bytes = 2;
234 unsigned cols = 0; 238 unsigned cols = 0;
235 unsigned opt; 239 unsigned opt;