diff options
author | Rob Austein <sra@hactrn.net> | 2016-10-19 02:00:43 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-10-19 02:00:43 -0400 |
commit | b252694ce6aafcdec2dd268196029f17ab0c6335 (patch) | |
tree | f165d10baaf1df978b117187f926fc273ca254a3 /ks_volatile.c | |
parent | c982e2e9344ab0c22f8c158cfb61da88485660d5 (diff) |
Shake first round of bugs out of hal_rpc_pkey_match().
The filtering code for this function has not been tested yet.
Diffstat (limited to 'ks_volatile.c')
-rw-r--r-- | ks_volatile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ks_volatile.c b/ks_volatile.c index df26471..2018adc 100644 --- a/ks_volatile.c +++ b/ks_volatile.c @@ -396,7 +396,11 @@ static hal_error_t ks_match(hal_ks_t *ks, *result_len = 0; - if ((err = hal_ks_index_find(&ksv->db->ksi, previous_uuid, 0, NULL, &i)) != HAL_OK) + err = hal_ks_index_find(&ksv->db->ksi, previous_uuid, 0, NULL, &i); + + if (err == HAL_ERROR_KEY_NOT_FOUND) + i--; + else if (err != HAL_OK) return err; while (*result_len < result_max) { |