diff options
author | Michael Morony <michael.morony@gmail.com> | 2007-08-24 08:14:21 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-08-24 08:14:21 +0200 |
commit | 1f7a36f2c0953c60a8d7acadc281285a0b84fb46 (patch) | |
tree | b36910854ba772c399da4ef6624443b5eba0b9fc /udevtrigger.c | |
parent | 7e599863919a62b0a072b5ca7a0037527d54d335 (diff) |
set buffer size if strlcpy/strlcat indicate truncation
Diffstat (limited to 'udevtrigger.c')
-rw-r--r-- | udevtrigger.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/udevtrigger.c b/udevtrigger.c index cf8f209b1c..309c54ab68 100644 --- a/udevtrigger.c +++ b/udevtrigger.c @@ -435,6 +435,8 @@ static void scan_failed(void) continue; start = strlcpy(device, sysfs_path, sizeof(device)); + if(start >= sizeof(device)) + start = sizeof(device) - 1; strlcat(device, dent->d_name, sizeof(device)); path_decode(&device[start]); device_list_insert(device); |