Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use curly quotes in C code samples #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ As we can see, often a longer string literal then the size argument is passed, e
## Bugs != vulnerabilities
A lot of bugs found that way are not security vulnerabilities. Though, it is possible there are some vulns like this. This could be:

* When a path is matched without its ending `/` character: `strncmp(var, path/, 4)`
* When an extension is incorrectly matched: `strncmp(var, .exe, 3)` and e.g. not filtered
* When a path is matched without its ending `/` character: `strncmp(var, "path/", 4)`
* When an extension is incorrectly matched: `strncmp(var, ".exe", 3)` and e.g. not filtered
* When parsing some format and mismatching some syntax due to wrong size
* When your other if branch is not reachable due to previous incorrect match ([almost a thing here](https://github.com/SerenityS/android_kernel_lge_g3/blob/lollipop/drivers/misc/tspdrv/touch_fops.c#L92-L98) - though they still do not unset the `IMMR_DEB` flag):
```c
if (strncmp(buf, debugon, 5) == 0) { IMMR_DEB = true; }
else if (strncmp(buf, debugoff, 8) == 0) { …}
if (strncmp(buf, "debugon", 5) == 0) { IMMR_DEB = true; }
else if (strncmp(buf, "debugoff", 8) == 0) { …}
```

## Reported or fixed bugs
Expand Down