summaryrefslogtreecommitdiff
path: root/mdadm.h
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2016-03-04 16:00:21 -0500
committerJes Sorensen <Jes.Sorensen@redhat.com>2016-03-09 11:35:34 -0500
commit193b6c0b26e2a722691ab7d8f67604429b0c9ac6 (patch)
treea81ce2851e83adb16dc051cf1c1bccd17467503c /mdadm.h
parent2a1990c0f4bbb00920fafe7c8eec1b8837595d48 (diff)
downloadmdadm-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-xmdadm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdadm.h b/mdadm.h
index 97aac52..3b96076 100755
--- a/mdadm.h
+++ b/mdadm.h
@@ -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,