chiark / gitweb /
make-public: Use cfgfile_log, not system_log
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 16:32:55 +0000 (16:32 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:51 +0000 (21:56 +0000)
Otherwise if this goes wrong, we segfault, because system_log is in
fact not available this early.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
pubkeys.c

index 903103f8399ae487f4f31ef92a6f26f5d9d30658..62f55259ef3efebd7ab9e1793155a72334582135 100644 (file)
--- a/pubkeys.c
+++ b/pubkeys.c
@@ -77,9 +77,12 @@ static list_t *makepublic_apply(closure_t *self, struct cloc loc,
     buf.size += base91s_decode_end(&b91,buf.start+buf.size);
     assert(buf.size <= buf.alloclen);
 
+    struct cfgfile_log log;
+    cfgfile_log_init(&log,loc,"make-public");
+
     struct sigpubkey_if *pubkey;
     closure_t *cl;
-    bool_t ok=sch->loadpub(sch,&buf,&pubkey,&cl,system_log,loc);
+    bool_t ok=sch->loadpub(sch,&buf,&pubkey,&cl,&log.log,loc);
     if (!ok) cfgfatal(loc,"make-public","public key loading failed");
 
     if (pubkey->sethash) {