mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #6840] [MERGED] bugfix: add NULL check for cmdline in find_child() #6190
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#6190
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/netblue30/firejail/pull/6840
Author: @lhywk
Created: 7/28/2025
Status: ✅ Merged
Merged: 7/29/2025
Merged by: @kmk3
Base:
master← Head:fix-null-deref-find_child📝 Commits (1)
9347da4fix: add NULL check for cmdline to prevent NULL dereference📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
src/jailcheck/utils.c(+2 -0)📄 Description
Describe
Add a NULL check for
cmdlinereturned bypid_proc_cmdline()in thefind_child()function.This prevents a possible NULL pointer dereference when accessing
strncmp(cmdline, ...).Version
Expected Behavior
When a process has
level == 2and is a child of the givenid,Firejail should safely check the command line and continue without crashing,
even if
pid_proc_cmdline()fails and returns NULL.Actual Behavior
If
pid_proc_cmdline()returns NULL (e.g. due to missing/proc/[pid]/cmdline),strncmp(cmdline, ...)dereferences a NULL pointer, which may lead to a crash.This is a small bugfix patch to improve robustness.
Not a security vulnerability, but aligns with NULL Pointer Dereference.
Thanks for reviewing.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.