mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-14 07:30:31 +01:00
dbus-uuidgen: Enable stack memory protection
Use "return" instead of "exit()" at the end of the main() function to enable runtime stack overflow checks. Using "return" allows the program to exit normally from main(), letting the compiler perform necessary cleanup operations, including stack canary verification. When using "exit()" at the end of main(), the __stack_chk_fail function is not invoked. $ objdump -T ./util/.libs/mtp-hotplug | grep __stack_chk_fail (This returns empty.) Signed-off-by: Hieu Nguyen <nvhieudt11@gmail.com>
This commit is contained in:
parent
1bcf396c78
commit
eac87979dc
1 changed files with 3 additions and 3 deletions
|
|
@ -125,7 +125,7 @@ main (int argc, char *argv[])
|
|||
if (get_uuid && ensure_uuid)
|
||||
{
|
||||
fprintf (stderr, "Can't specify both --get and --ensure\n");
|
||||
exit (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
dbus_error_init (&error);
|
||||
|
|
@ -155,10 +155,10 @@ main (int argc, char *argv[])
|
|||
{
|
||||
fprintf (stderr, "%s\n", error.message);
|
||||
dbus_error_free (&error);
|
||||
exit (1);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
exit (0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue