summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-06-03 10:25:29 +0000
committertb <>2025-06-03 10:25:29 +0000
commitdaafaf5616bdc547f23dfc260752e0713ca3d654 (patch)
treeb9715ff4737863879d07b546b697c38fd460c7f9 /src
parent82cb6d2187c46a5ca3bf09876c4b839881659abc (diff)
downloadopenbsd-daafaf5616bdc547f23dfc260752e0713ca3d654.tar.gz
openbsd-daafaf5616bdc547f23dfc260752e0713ca3d654.tar.bz2
openbsd-daafaf5616bdc547f23dfc260752e0713ca3d654.zip
parse_test_file: add missing error checks for init()
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/mlkem/parse_test_file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/mlkem/parse_test_file.c b/src/regress/lib/libcrypto/mlkem/parse_test_file.c
index b68dc50431..1bb2d3af9b 100644
--- a/src/regress/lib/libcrypto/mlkem/parse_test_file.c
+++ b/src/regress/lib/libcrypto/mlkem/parse_test_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: parse_test_file.c,v 1.4 2025/04/13 09:14:56 tb Exp $ */ 1/* $OpenBSD: parse_test_file.c,v 1.5 2025/06/03 10:25:29 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org>
@@ -646,7 +646,8 @@ parse_reinit(struct parse *p)
646 p->state.running_test_case = 0; 646 p->state.running_test_case = 0;
647 parse_line_data_clear(p); 647 parse_line_data_clear(p);
648 tctx->finish(p->ctx); 648 tctx->finish(p->ctx);
649 tctx->init(p->ctx, p); 649 if (!tctx->init(p->ctx, p))
650 parse_errx(p, "init failed");
650} 651}
651 652
652static int 653static int
@@ -708,7 +709,8 @@ parse_init(struct parse *p, const char *fn, const struct test_parse *tctx,
708 parse_state_init(&p->state, tctx->num_states, tctx->num_instructions); 709 parse_state_init(&p->state, tctx->num_states, tctx->num_instructions);
709 p->tctx = tctx; 710 p->tctx = tctx;
710 p->ctx = ctx; 711 p->ctx = ctx;
711 tctx->init(ctx, p); 712 if (!tctx->init(p->ctx, p))
713 parse_errx(p, "init failed");
712} 714}
713 715
714static int 716static int