Skip to content
Snippets Groups Projects

various: fix mishandling of failed `asprintf()` calls

Closed Lyndon Brown requested to merge jnqnfe/vlc:invalid_frees into master

On allocation failure or error asprintf() returns -1 rather than a count of characters, and the pointer, in some implementations, is left in an undefined state.

This MR:

  • Fixes cases of reads and/or free() happening with such pointers when in such an undefined state.
  • In one case (lua) it's non-trivial to assess whether or not there is an existing misuse in the calling code that owns the pointer.
  • Fixes a few cases where inverted logic was causing the wrong success/failure paths to be taken.
  • Fixes a few cases where success / failure was being incorrectly determined through use of a ! based condition check.
Edited by Lyndon Brown

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading