mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
udev/ata_id: zero out variable properly
b8a2b0f76 'use initalization instead of explicit zeroing' introduced a bug where only the first sizeof(uint_t*) bytes would be zeroed out, instead of the whole array.
This commit is contained in:
parent
e9b807c168
commit
1e8e0a3221
@ -334,11 +334,10 @@ static int disk_identify(struct udev *udev,
|
|||||||
int peripheral_device_type;
|
int peripheral_device_type;
|
||||||
int all_nul_bytes;
|
int all_nul_bytes;
|
||||||
int n;
|
int n;
|
||||||
int is_packet_device;
|
int is_packet_device = 0;
|
||||||
|
|
||||||
/* init results */
|
/* init results */
|
||||||
zero(out_identify);
|
memzero(out_identify, 512);
|
||||||
is_packet_device = 0;
|
|
||||||
|
|
||||||
/* If we were to use ATA PASS_THROUGH (12) on an ATAPI device
|
/* If we were to use ATA PASS_THROUGH (12) on an ATAPI device
|
||||||
* we could accidentally blank media. This is because MMC's BLANK
|
* we could accidentally blank media. This is because MMC's BLANK
|
||||||
@ -402,7 +401,7 @@ static int disk_identify(struct udev *udev,
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
if (out_is_packet_device != NULL)
|
if (out_is_packet_device != NULL)
|
||||||
*out_is_packet_device = is_packet_device;
|
*out_is_packet_device = is_packet_device;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user