-
Notifications
You must be signed in to change notification settings - Fork 542
Open
Description
Description
The writercwtdata() function in src/lib_ccx/output.c currently uses a static array for the cbbuffer variable. There's a TODO comment requesting to replace this with dynamic memory allocation using malloc.
File: src/lib_ccx/output.c
Line: ~156
Function: writercwtdata()
Current Implementation
static unsigned char cbbuffer[0xFFFF * 3]; // TODO: use mallocProposed Change
Replace the static array with dynamically allocated memory to:
- Improve memory efficiency
- Follow modern C best practices
- Only allocate memory when the function is actually used
Benefits
- Memory is only allocated when needed
- Better resource management
- Maintains backward compatibility
- No change to external behavior
Implementation Plan
I'm working on a PR that will:
- Convert
cbbufferfrom static array to dynamically allocated pointer - Allocate memory on first use of the function
- Add proper error handling for allocation failures
- Add debug logging for buffer allocation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels