Skip to content

Commit aa8c93a

Browse files
dpageclaude
andcommitted
Add remaining security suppressions for Semgrep and flawfinder
- Add nosemgrep comments for memcpy warnings in curl callbacks - Add missing flawfinder ignore for strlen in hybrid_chunking.c All flagged security issues are false positives - the buffers are properly sized via repalloc before memcpy, and all strings are null-terminated from PostgreSQL or internal palloc allocation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6a234e1 commit aa8c93a

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

src/hybrid_chunking.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ elements_to_chunks_simple(List *elements, ChunkConfig *config)
962962
{
963963
/* Split large elements at natural boundaries */
964964
const char *content = elem->content;
965+
/* flawfinder: ignore - elem->content is palloc'd, null-terminated */
965966
int content_len = strlen(content);
966967
int start_offset = 0;
967968

src/provider_ollama.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ write_callback(void *contents, size_t size, size_t nmemb, void *userp)
233233

234234
mem->data = ptr;
235235
/* flawfinder: ignore - buffer was realloced to mem->size + realsize + 1 */
236-
memcpy(&(mem->data[mem->size]), contents, realsize);
236+
memcpy(&(mem->data[mem->size]), contents, realsize); /* nosemgrep */
237237
mem->size += realsize;
238238
mem->data[mem->size] = 0;
239239

src/provider_openai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ write_callback(void *contents, size_t size, size_t nmemb, void *userp)
243243

244244
mem->data = ptr;
245245
/* flawfinder: ignore - buffer was realloced to mem->size + realsize + 1 */
246-
memcpy(&(mem->data[mem->size]), contents, realsize);
246+
memcpy(&(mem->data[mem->size]), contents, realsize); /* nosemgrep */
247247
mem->size += realsize;
248248
mem->data[mem->size] = 0;
249249

src/provider_voyage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ write_callback(void *contents, size_t size, size_t nmemb, void *userp)
244244

245245
mem->data = ptr;
246246
/* flawfinder: ignore - buffer was realloced to mem->size + realsize + 1 */
247-
memcpy(&(mem->data[mem->size]), contents, realsize);
247+
memcpy(&(mem->data[mem->size]), contents, realsize); /* nosemgrep */
248248
mem->size += realsize;
249249
mem->data[mem->size] = 0;
250250

0 commit comments

Comments
 (0)