[PR #52] [MERGED] Clean up some fragile uses of strncmp. #3527

Closed
opened 2026-05-05 10:03:06 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/52
Author: @sarneaud
Created: 9/1/2015
Status: Merged
Merged: 9/1/2015
Merged by: @netblue30

Base: masterHead: strncmp


📝 Commits (1)

  • 78fd720 Clean up some fragile uses of strncmp.

📊 Changes

2 files changed (+5 additions, -5 deletions)

View changed files

📝 src/firejail/caps.c (+1 -1)
📝 src/firejail/fs.c (+4 -4)

📄 Description

In some places the code compares the first n characters of a string and
then assumes a valid string starts from the n+2th character. I didn't
find any places where this wasn't justifiable, but I think it's better
to stick to safer patterns, especially in SUID code.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/52 **Author:** [@sarneaud](https://github.com/sarneaud) **Created:** 9/1/2015 **Status:** ✅ Merged **Merged:** 9/1/2015 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `strncmp` --- ### 📝 Commits (1) - [`78fd720`](https://github.com/netblue30/firejail/commit/78fd72058fcbad63b0fe75f4b0db7c31c5c2a744) Clean up some fragile uses of strncmp. ### 📊 Changes **2 files changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/caps.c` (+1 -1) 📝 `src/firejail/fs.c` (+4 -4) </details> ### 📄 Description In some places the code compares the first n characters of a string and then assumes a valid string starts from the n+2th character. I didn't find any places where this wasn't justifiable, but I think it's better to stick to safer patterns, especially in SUID code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:03:06 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#3527
No description provided.