From 42eae549753868d4a0043f8476a1b66f7f6c766c Mon Sep 17 00:00:00 2001 From: manni07 Date: Mon, 2 Mar 2026 23:33:37 +0100 Subject: [PATCH] fix(HIGH-04): add OOM guard for mask calloc in stories_mil.h - stories_mil.h: get_mask_blob() mask calloc now guarded with abort() on NULL before immediate array write ref: docs/reports/security-audit-2026-03-02.md HIGH-04 --- training/stories_mil.h | 1 + 1 file changed, 1 insertion(+) diff --git a/training/stories_mil.h b/training/stories_mil.h index dccca44..167d2b8 100644 --- a/training/stories_mil.h +++ b/training/stories_mil.h @@ -277,6 +277,7 @@ static NSData *g_mask_blob = nil; static NSData *get_mask_blob(void) { if (!g_mask_blob) { _Float16 *mask = (_Float16*)calloc(SEQ*SEQ, sizeof(_Float16)); + if (!mask) { fprintf(stderr, "OOM: calloc(mask %dx%d)\n", SEQ, SEQ); abort(); } // HIGH-04 for(int t=0;t