From e13dfeda330625d2fecc3a54672dfd4dc9c83a5c Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 18 Jun 2026 17:58:10 +0200 Subject: [PATCH] common: Fix return value and typos in flatpak_switch_symlink_and_remove One error path returned -1 instead of FALSE. Since gboolean is gint, -1 is truthy and the caller would skip error handling. Assisted-by: Claude:opus-4.6 Helps: https://github.com/flatpak/flatpak/security/advisories/GHSA-99wv-m8rp-g58x --- common/flatpak-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index d0852dd18..5b24a0c76 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -983,10 +983,10 @@ flatpak_str_is_alphanumeric (const char *arg) } /* This atomically replaces a symlink with a new value, removing the - * existing symlink target, if it exstis and is different from + * existing symlink target, if it exists and is different from * @target. This is atomic in the sense that we're guaranteed to * remove any existing symlink target (once), independent of how many - * processes do the same operation in parallele. However, it is still + * processes do the same operation in parallel. However, it is still * possible that we remove the old and then fail to create the new * symlink for some reason, ending up with neither the old or the new * target. That is fine if the reason for the symlink is keeping a @@ -1038,7 +1038,7 @@ flatpak_switch_symlink_and_remove (const char *symlink_path, if (old_target == NULL) return FALSE; - /* Don't remove old file if its the same as the new one */ + /* Don't remove old file if it's the same as the new one */ if (strcmp (old_target, target) != 0) { if (flatpak_str_is_alphanumeric (old_target)) @@ -1058,7 +1058,7 @@ flatpak_switch_symlink_and_remove (const char *symlink_path, { glnx_set_error_from_errno (error); unlink (tmp_path); - return -1; + return FALSE; } unlink (tmp_path);