@@ -304,23 +304,22 @@ test_ini_parse_file_normal(void **state)
304304}
305305
306306/* ------------------------------------------------------------------------ */
307- /* TC-U-P0-INI-12: ini_parse_file with NULL FILE* — SKIP */
307+ /* TC-U-P0-INI-12: ini_parse_file( NULL, ...) -> -1 (defensive NULL guard) */
308308/* */
309- /* Empirically verified during Stage-2 implementation that calling */
310- /* ini_parse_file(NULL, ...) */
311- /* on glibc 2.x triggers SIGSEGV inside fgets(_, _, NULL). This is a real */
312- /* robustness gap in lib/ff_ini_parser.c — fixing it requires guarding the */
313- /* file pointer or wrapping fgets, which is out-of-scope for the unit-test */
314- /* phase (DP-U-11 forbids editing lib source). */
315- /* */
316- /* Filed as FU-S2-NULLFILE for follow-up; this TC is preserved as `skip()` */
317- /* so that future commits adding the NULL-guard automatically re-enable it. */
309+ /* lib/ff_ini_parser.c gained an explicit NULL FILE* check at the entry of */
310+ /* ini_parse_file (commit FU-S2-NULLFILE), aligning the failure semantics */
311+ /* with ini_parse(filename) returning -1 on fopen failure. The TC verifies */
312+ /* the function: */
313+ /* (a) returns -1 (never crashes / SIGSEGVs) */
314+ /* (b) does not invoke the handler (zero records captured) */
318315/* ------------------------------------------------------------------------ */
319316static void
320317test_ini_parse_file_null (void * * state )
321318{
322- (void )state ;
323- skip (); /* FU-S2-NULLFILE: lib/ff_ini_parser.c lacks NULL FILE* guard */
319+ capture_ctx_t * ctx = * state ;
320+ int rv = ini_parse_file (NULL , capture_handler , ctx );
321+ assert_int_equal (rv , -1 );
322+ assert_int_equal (ctx -> count , 0 );
324323}
325324
326325/* ------------------------------------------------------------------------ */
0 commit comments