diff options
author | Andrew Price <anprice@redhat.com> | 2013-09-05 17:35:04 +0100 |
---|---|---|
committer | Andrew Price <anprice@redhat.com> | 2013-09-05 17:35:04 +0100 |
commit | 20498553106d146be743e07b6f65cd512be10c9e (patch) | |
tree | 39c214cef1ada1f626f39fa6c2e4879be363cacc | |
parent | 069b9565b5a4b75e6d484f269ad5d9bd02dbd17f (diff) | |
download | iowatcher-20498553106d146be743e07b6f65cd512be10c9e.tar.gz |
Fix a label overflow in plot_io
The length of the label option wasn't being checked before strcpy()ing
it into a char[256]. Use strncpy instead.
Signed-off-by: Andrew Price <anprice@redhat.com>
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -747,7 +747,8 @@ static void plot_io(struct plot *plot, int min_seconds, int max_seconds, u64 min if (!tf->label) label[0] = 0; else { - strcpy(label, tf->label); + strncpy(label, tf->label, 255); + label[255] = 0; if (io_per_process) strcat(label, " "); } |