X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/624271c6fb16195ebdab6817029d8c37ef673e7c..8d14d66b84cc370cefe54b33de1b95bb49c90bf6:/keydb_pg.c?ds=sidebyside diff --git a/keydb_pg.c b/keydb_pg.c index 25881c0..85ea500 100644 --- a/keydb_pg.c +++ b/keydb_pg.c @@ -218,7 +218,7 @@ static int pg_fetch_key_text(const char *search, newsearch = malloc(strlen(search) * 2 + 1); memset(newsearch, 0, strlen(search) * 2 + 1); - PQescapeString(newsearch, search, strlen(search)); + PQescapeStringConn(dbconn, newsearch, search, strlen(search), NULL); snprintf(statement, 1023, "SELECT DISTINCT onak_keys.keydata FROM onak_keys, " "onak_uids WHERE onak_keys.keyid = onak_uids.keyid " @@ -408,8 +408,8 @@ static int pg_store_key(struct openpgp_publickey *publickey, bool intrans, safeuid = malloc(strlen(uids[i]) * 2 + 1); if (safeuid != NULL) { memset(safeuid, 0, strlen(uids[i]) * 2 + 1); - PQescapeString(safeuid, uids[i], - strlen(uids[i])); + PQescapeStringConn(dbconn, safeuid, uids[i], + strlen(uids[i]), NULL); snprintf(statement, 1023, "INSERT INTO onak_uids " @@ -608,7 +608,7 @@ static int pg_iterate_keys(void (*iterfunc)(void *ctx, } else { read_openpgp_stream(keydb_fetchchar, &fd, &packets, 0); - parse_keys(packets, key); + parse_keys(packets, &key); lo_close(dbconn, fd); iterfunc(ctx, key);