From 582edbc2468c1dd00d0ede595cdf494f6d7e0bc8 Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Wed, 8 Nov 2023 15:52:17 +0200 Subject: [PATCH] disk: check for null pointer when writing through fak_o --- pkg/vere/disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/vere/disk.c b/pkg/vere/disk.c index a3cf36b8af..de141988bd 100644 --- a/pkg/vere/disk.c +++ b/pkg/vere/disk.c @@ -758,7 +758,9 @@ u3_disk_read_meta(MDB_env* mdb_u, } } else if ( (1 == val_u.hav_i) || !((*val_u.buf_y) >> 1) ) { - *fak_o = (*val_u.buf_y) & 1; + if ( fak_o ) { + *fak_o = (*val_u.buf_y) & 1; + } } else { fprintf(stderr, "disk: read meta: invalid fake bit %u %zd\r\n",