X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=cgi%2Fhashquery.c;h=d750608b812342cc9160c70bc574ab73b42e0294;hb=9aadc77b48c7826015f8ec87cebdc15d012c5f14;hp=84efe97e514ae7b89d254b46e626fd9a416e8ac4;hpb=9d8830c7ea9fd00ded77072cdfd333c5c4e39813;p=onak.git diff --git a/cgi/hashquery.c b/cgi/hashquery.c index 84efe97..d750608 100644 --- a/cgi/hashquery.c +++ b/cgi/hashquery.c @@ -74,7 +74,7 @@ int main(__unused int argc, __unused char *argv[]) } hashes = (uint8_t **) unmarshal_array(buffer_fetchchar, &cgipostbuf, - (void * (*)(int (*)(void *, size_t, void *), void *)) + (void * (*)(size_t (*)(void *, size_t, void *), void *)) unmarshal_skshash, &count); free(cgipostbuf.buffer); @@ -94,6 +94,10 @@ int main(__unused int argc, __unused char *argv[]) catchsignals(); dbctx = config.dbinit(config.backend, false); + if (dbctx == NULL) { + doerror("Failed to open key database."); + } + if (dbctx->fetch_key_skshash == NULL) { dbctx->cleanupdb(dbctx); doerror("Can't fetch by skshash with this backend."); @@ -115,7 +119,7 @@ int main(__unused int argc, __unused char *argv[]) puts("Content-Type: pgp/keys\n"); marshal_array(stdout_putchar, NULL, - (void (*)(int (*)(void *, size_t, void *), + (void (*)(size_t (*)(void *, size_t, void *), void *, const void *)) marshal_publickey, (void **) keys, found); printf("\n");