no error handling of key_schedule_new failure
- Dominant language
- C
- Stars
- 640
- Forks
- 173
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 3
Description
`key_schedule_new` is called from two places, but neither one checks for NULL return value.
As a result, failure to create a hash alg results in a crash (seg fault) happening later on in an unrelated spot.
Can we add something like this after calling `key_schedule_new` in these two spots?
```
if (tls->key_schedule == NULL) {
ret = PTLS_ERROR_NO_MEMORY;
goto Exit;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the repository for the two calls to key_schedule_new and inspect how each caller handles errors and exits. Add the requested NULL-failure handling in both locations, then verify that allocation failure returns PTLS_ERROR_NO_MEMORY rather than causing a later crash.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100