mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 03:45:02 +01:00
dmu_recv: Avoid potential null deref
Compilers are smart enough to deref only if the first && operand is true, so this is mostly to avoid false positives from sanitizers. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Igor Ostapenko <[email protected]> Closes #18848
This commit is contained in:
1 parent
a04c401389
commit
3020c18ca8
1 file changed
+3
-1
@@ -3402,7 +3402,9 @@ receive_process_write_record(struct receive_writer_arg *rwa,
|
||||
}
|
||||
|
||||
struct receive_record_arg *first_rrd = list_head(&rwa->write_batch);
|
||||
struct drr_write *first_drrw = &first_rrd->header.drr_u.drr_write;
|
||||
struct drr_write *first_drrw = NULL;
|
||||
if (first_rrd != NULL)
|
||||
first_drrw = &first_rrd->header.drr_u.drr_write;
|
||||
uint64_t batch_size =
|
||||
MIN(zfs_recv_write_batch_size, DMU_MAX_ACCESS / 2);
|
||||
if (first_rrd != NULL &&
|
||||
|
||||
Reference in new issue
Block a user