From ddea446252fad05bc28ede2ee2043f8d96addd65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 8 Apr 2016 21:08:54 -0400 Subject: [PATCH] journal: assert gcry_mpi_scan succeeded It might be nicer to propagate the error to the caller, but that'd be a bigger refactoring. This shouldn't really fail, so just add an assert. CID #1349697. --- src/journal/fsprg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/fsprg.c b/src/journal/fsprg.c index 8956eb1d58a..612b10f3a9a 100644 --- a/src/journal/fsprg.c +++ b/src/journal/fsprg.c @@ -58,7 +58,7 @@ static gcry_mpi_t mpi_import(const void *buf, size_t buflen) { gcry_mpi_t h; unsigned len; - gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL); + assert_se(gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL) == 0); len = (gcry_mpi_get_nbits(h) + 7) / 8; assert(len <= buflen); assert(gcry_mpi_cmp_ui(h, 0) >= 0); -- 2.39.5