From: Daniel Golle Date: Tue, 7 Aug 2018 16:07:56 +0000 (+0200) Subject: blob_buf needs to be zero'd X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=63ad591e5983503fefa00ed0488b0bfd74b2a80d;p=oweals%2Fucert.git blob_buf needs to be zero'd Fixes weird segfaults when compiling libubox with GCC 8. Signed-off-by: Daniel Golle --- diff --git a/ucert.c b/ucert.c index 6cdc220..53a1a05 100644 --- a/ucert.c +++ b/ucert.c @@ -183,7 +183,7 @@ static int cert_load(const char *certfile, struct list_head *chain) { static int cert_append(const char *certfile, const char *sigfile) { FILE *fs; char filebuf[CERT_BUF_LEN]; - struct blob_buf sigbuf; + struct blob_buf sigbuf = {0}; int len; int ret; @@ -406,8 +406,8 @@ static int cert_dump(const char *certfile) { /* issue an auth certificate for pubkey */ static int cert_issue(const char *certfile, const char *pubkeyfile, const char *seckeyfile) { - struct blob_buf certbuf; - struct blob_buf payloadbuf; + struct blob_buf payloadbuf = {0}; + struct blob_buf certbuf = {0}; struct timeval tv; int pklen, siglen; int revoker = 1;