openwall / openwall/blists

Handle and report memory allocation errors

Open
#1 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
15
Forks
4
PR merge metrics
No merged PRs in 30d

Description

blists does check for errors from malloc and realloc, but it does so in its lower-level wrappers such as buffer_grow, msgs_grow, and concat. The higher-level and /indirect callers of those do not always check whether an error occurred (example: uses of concat in html_error_real) or when they do they might not make it clear to the sysadmin what the issue really is (example: msgs_grow failure in begin_inc_idx will result in non-incremental index update with no reason given as to why, which is especially unexpected to a sysadmin given that the underlying realloc can sometimes momentarily need almost 2x more memory than the requested new size).

We should review these cases and introduce reasonable error reporting.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the error paths in buffer_grow, msgs_grow, and concat, then inspect their higher-level and indirect callers, especially concat in html_error_real and msgs_grow in begin_inc_idx. Done means allocation failures are consistently checked and reported with a useful reason to the sysadmin; no files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.