Skip to content

[BUG] Unchecked strdup() return values in multiple lib_ccx files. #2194

@Navdeepkaur-11

Description

@Navdeepkaur-11

Summary:
Multiple strdup() calls across lib_ccx are missing NULL checks.
If allocation fails, this causes NULL pointer dereferences
or undefined behavior.

Files affected:

  • ccx_encoders_helpers.c line 100 — strdup() result passed
    directly to strtok() without NULL check
  • ccx_encoders_helpers.c line 129 — same pattern
  • output.c line 76 — strdup() result stored without NULL check
  • ccx_common_common.c line 61 — strdup() result stored without NULL check
  • matroska.c line 1047 — similar to already fixed [BUG] Unchecked strdup return value in matroska.c #2159

Suggested Fix:
Add NULL check with fatal(EXIT_NOT_ENOUGH_MEMORY, ...)
after each strdup() call, consistent with existing
pattern in ocr.c line 57.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions