diff options
| author | Trung Lê <8@tle.id.au> | 2026-02-22 11:29:18 +1100 |
|---|---|---|
| committer | Trung Lê <8@tle.id.au> | 2026-02-22 11:29:18 +1100 |
| commit | 9690617ae3855ab9f58e5bce0f55b4842b9832e5 (patch) | |
| tree | 22fb5532cbaf4a6f0c4b1714f563aebf68b52918 /src/gsr-info.c | |
| parent | 442c8be65ac2ba1fdcbcfa8204adec5fecb2c474 (diff) | |
Prepare 1.0.0: fix memory leaks, use-after-free bugs, and code quality issues
- Version 6.0.0 → 1.0.0, C standard gnu17 → gnu23
- Fix desktop file path (was referencing parent directory)
- global_shortcuts.c: fix systematic GVariant/GDBusProxy leaks, guint64-to-gchar*
type mismatch, buffer overflow risk, missing malloc NULL checks, debug artifacts
- gsr-window.c: fix notification timeout use-after-free, menu object leak in
finalize, localtime NULL check, extract active_mode_to_string helper
- gsr-stream-page.c, gsr-record-page.c, gsr-replay-page.c: fix timer source
leak in finalize (use-after-free if destroyed while timer running)
- gsr-shortcut-accel-dialog.c: fix Pango markup injection via shortcut titles
- gsr-info.c: fix pclose UB, replace fprintf with g_warning
- gsr-config.c: include errno in fopen failure warning
- Remove unused include, stale Phase 5 comments
Diffstat (limited to 'src/gsr-info.c')
| -rw-r--r-- | src/gsr-info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsr-info.c b/src/gsr-info.c index 04da95c..4187aed 100644 --- a/src/gsr-info.c +++ b/src/gsr-info.c @@ -32,7 +32,7 @@ read_command_output(const char *cmd, int *exit_code) int status = pclose(f); if (exit_code) { - if (WIFEXITED(status)) + if (status >= 0 && WIFEXITED(status)) *exit_code = WEXITSTATUS(status); else *exit_code = -1; @@ -223,7 +223,7 @@ gsr_info_load(GsrInfo *info) int exit_code = -1; char *output = read_command_output("gpu-screen-recorder --info", &exit_code); if (!output) { - fprintf(stderr, "error: 'gpu-screen-recorder --info' failed to run\n"); + g_warning("'gpu-screen-recorder --info' failed to run"); return GSR_INFO_EXIT_FAILED_TO_RUN; } |
