projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d4e7d1
)
journal: assert gcry_mpi_scan succeeded
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:54 +0000
(21:08 -0400)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:54 +0000
(21:08 -0400)
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
patch
|
blob
|
history
diff --git
a/src/journal/fsprg.c
b/src/journal/fsprg.c
index 8956eb1d58a572d0a37dd60de3cdefba204d9cfc..612b10f3a9afea1d90614b825680cf6b32052a61 100644
(file)
--- 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);