damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 4109649dc206c80e30fa392f61284c472981d131
parent 466dfcb7d7f08fe62a8537e6b1abe905ca5881e8
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 23 Nov 2023 12:45:19 -0800

nostrdb/filter: make sure we only match single chars

Without this, we could accidently match `pr` for `#p` filters

Fixes: 30ed801285dd ("filters: add initial filter interface")
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mnostrdb/nostrdb.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nostrdb/nostrdb.c b/nostrdb/nostrdb.c @@ -425,7 +425,7 @@ static int ndb_generic_filter_matches(struct ndb_filter_elements *els, continue; // do we have #e matching e (or p, etc) - if (str.str[0] != els->field.generic) + if (str.str[0] != els->field.generic || str.str[1] != 0) continue; str = ndb_note_str(note, &it->tag->strs[1]);