diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-03-04 16:00:21 -0500 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-03-09 11:35:34 -0500 |
commit | 193b6c0b26e2a722691ab7d8f67604429b0c9ac6 (patch) | |
tree | a81ce2851e83adb16dc051cf1c1bccd17467503c /mdadm.h | |
parent | 2a1990c0f4bbb00920fafe7c8eec1b8837595d48 (diff) | |
download | mdadm-193b6c0b26e2a722691ab7d8f67604429b0c9ac6.tar.gz |
load_sys(): Add a buffer size argument
This adds a buffer size argument to load_sys(), rather than relying on
a hard coded buffer size. The old behavior was safe because we knew
the kernel would never return strings overrunning the buffers, however
it was ugly, and would cause code checking tools to spit out warnings.
This caused a Coverity warning over the read into
sra->sysfs_array_state which is only 20 bytes.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Diffstat (limited to 'mdadm.h')
-rwxr-xr-x | mdadm.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -631,7 +631,7 @@ extern int sysfs_disk_to_scsi_id(int fd, __u32 *id); extern int sysfs_unique_holder(char *devnm, long rdev); extern int sysfs_freeze_array(struct mdinfo *sra); extern int sysfs_wait(int fd, int *msec); -extern int load_sys(char *path, char *buf); +extern int load_sys(char *path, char *buf, int len); extern int reshape_prepare_fdlist(char *devname, struct mdinfo *sra, int raid_disks, |