Make sure some variables are initialised since modern gcc warns about them.
authorclaudio <claudio@openbsd.org>
Tue, 11 May 2021 11:48:02 +0000 (11:48 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 11 May 2021 11:48:02 +0000 (11:48 +0000)
Handle rrdppid like we do for all other child processes. The two warnings
in rrdp are probably false positives.
OK tb@

usr.sbin/rpki-client/main.c
usr.sbin/rpki-client/rrdp_delta.c
usr.sbin/rpki-client/rrdp_notification.c

index 5645c39..40bb51d 100644 (file)
@@ -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 <kristaps@bsd.lv>
  *
@@ -861,8 +861,10 @@ main(int argc, char *argv[])
 
                close(fd[0]);
                rrdp = fd[1];
-       } else
+       } else {
                rrdp = -1;
+               rrdppid = -1;
+       }
 
        if (timeout) {
                /*
index 7957a72..774f0b1 100644 (file)
@@ -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;
 
index 6ad1006..9ff8c9a 100644 (file)
@@ -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);