From: claudio Date: Tue, 11 May 2021 11:48:02 +0000 (+0000) Subject: Make sure some variables are initialised since modern gcc warns about them. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c9585076901c76a1b313c5f52698b07d75d05399;p=openbsd Make sure some variables are initialised since modern gcc warns about them. Handle rrdppid like we do for all other child processes. The two warnings in rrdp are probably false positives. OK tb@ --- diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c index 5645c398963..40bb51d869c 100644 --- a/usr.sbin/rpki-client/main.c +++ b/usr.sbin/rpki-client/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.140 2021/05/11 11:43:21 claudio Exp $ */ +/* $OpenBSD: main.c,v 1.141 2021/05/11 11:48:02 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -861,8 +861,10 @@ main(int argc, char *argv[]) close(fd[0]); rrdp = fd[1]; - } else + } else { rrdp = -1; + rrdppid = -1; + } if (timeout) { /* diff --git a/usr.sbin/rpki-client/rrdp_delta.c b/usr.sbin/rpki-client/rrdp_delta.c index 7957a72be72..774f0b15a1c 100644 --- a/usr.sbin/rpki-client/rrdp_delta.c +++ b/usr.sbin/rpki-client/rrdp_delta.c @@ -115,7 +115,7 @@ start_publish_withdraw_elem(struct delta_xml *dxml, const char **attr, int withdraw) { XML_Parser p = dxml->parser; - char *uri, hash[SHA256_DIGEST_LENGTH]; + char *uri = NULL, hash[SHA256_DIGEST_LENGTH]; int i, hasUri = 0, hasHash = 0; enum publish_type pub = PUB_UPD; diff --git a/usr.sbin/rpki-client/rrdp_notification.c b/usr.sbin/rpki-client/rrdp_notification.c index 6ad1006d921..9ff8c9ae248 100644 --- a/usr.sbin/rpki-client/rrdp_notification.c +++ b/usr.sbin/rpki-client/rrdp_notification.c @@ -351,7 +351,7 @@ enum rrdp_task notification_done(struct notification_xml *nxml, char *last_mod) { struct delta_item *d; - long long s, last_s; + long long s, last_s = 0; nxml->current->last_mod = last_mod; nxml->current->session_id = xstrdup(nxml->session_id);