Skip to content

Commit

Permalink
Fix the incorrect call to memset in app/memcmp, causing undefined beh…
Browse files Browse the repository at this point in the history
…avior

The memset call did effectively nothing because it set zero bytes.
  • Loading branch information
Wojciech Aleksander Woloszyn committed Aug 26, 2024
1 parent 08895a1 commit 5bd6f0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/memcmp/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void register_signal_handler(int signo)
struct sigaction act, old_act;

/* Specify #PF handler with signinfo arguments */
memset(&act, sizeof(sigaction), 0);
memset(&act, 0, sizeof(sigaction));
act.sa_sigaction = fault_handler;
act.sa_flags = SA_RESTART | SA_SIGINFO;

Expand Down

0 comments on commit 5bd6f0c

Please sign in to comment.