nostrdb/subs: always fail when calling wait_for_notes on a subid of 0
this is an invalid subscription id Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
b1bbf355de
commit
9c2f7a931c
@@ -4954,6 +4954,11 @@ int ndb_wait_for_notes(struct ndb *ndb, uint64_t subid, uint64_t *note_ids,
|
|||||||
int note_id_capacity)
|
int note_id_capacity)
|
||||||
{
|
{
|
||||||
struct ndb_subscription *sub;
|
struct ndb_subscription *sub;
|
||||||
|
|
||||||
|
// this is not a valid subscription id
|
||||||
|
if (subid == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!(sub = ndb_find_subscription(ndb, subid)))
|
if (!(sub = ndb_find_subscription(ndb, subid)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user