OpenPrinting / OpenPrinting/cups-filters
Potential NULL pointer dereference cases
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 197
- Forks
- 158
- Avg merge
- 3h 29m
- Merged PRs (30d)
- 1
Description
Hello! I found some issues via a SAST tool. They are not critical, but I hope this information could be useful.
There are two potential NULL pointer dereference cases:
- filter/rastertopclx.c
ppdLutLoad() and cfLutNew() can return NULL if the nested calloc() function fails. There is no check on line 443:
Add a NULL check of cfLutNew() result.
- filter/foomatic-rip/spooler.c
The HOME environment variable is usually defined in user environments, but this isn't guaranteed.
Add a NULL check of getenv("HOME") result.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cited sections of filter/rastertopclx.c around line 443 and filter/foomatic-rip/spooler.c around line 229. Trace the return values from cfLutNew() and getenv("HOME") and review nearby error-handling conventions. Done means both potential NULL cases are handled without dereferencing NULL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100