CCExtractor / CCExtractor/ccextractor

Replace static buffer with dynamic allocation in writercwtdata()

オープン
#2,091 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C
スター
903
フォーク
589
平均マージ
3日 2時間
マージ済み PR(30日)
10

説明

## 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
```c
static unsigned char cbbuffer[0xFFFF * 3]; // TODO: use malloc
```

## Proposed 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
1. Memory is only allocated when needed
2. Better resource management
3. Maintains backward compatibility
4. No change to external behavior

## Implementation Plan
I'm working on a PR that will:
1. Convert `cbbuffer` from static array to dynamically allocated pointer
2. Allocate memory on first use of the function
3. Add proper error handling for allocation failures
4. Add debug logging for buffer allocation

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。