diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-22 15:45:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-22 15:45:35 -0400 |
commit | 63747ac6534e3092f703527ba809eb93034bd57b (patch) | |
tree | 924420a1cb2a6e58f234d586301c1ec44793d745 | |
parent | 54b6beabf05b6cf62092f98f0c06395e4242b064 (diff) | |
download | bcachefs-tools-63747ac6534e3092f703527ba809eb93034bd57b.tar.gz |
Fix null ptr deref in bbpos_parse()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | tools-util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools-util.c b/tools-util.c index 624656a1..81ce63ae 100644 --- a/tools-util.c +++ b/tools-util.c @@ -671,6 +671,10 @@ struct bbpos bbpos_parse(char *buf) die("invalid bbpos %s", buf); ret.btree = read_string_list_or_die(field, bch2_btree_ids, "btree id"); + + if (!s) + die("invalid bbpos %s", buf); + ret.pos = bpos_parse(s); return ret; } |