From: Zbigniew Jędrzejewski-Szmek Date: Sat, 9 Apr 2016 01:08:54 +0000 (-0400) Subject: journal: assert gcry_mpi_scan succeeded X-Git-Tag: v230~194^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ddea446252fad05bc28ede2ee2043f8d96addd65;p=thirdparty%2Fsystemd.git 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. --- 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);