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 /udevinfo.c | |
parent | 7e599863919a62b0a072b5ca7a0037527d54d335 (diff) |
set buffer size if strlcpy/strlcat indicate truncation
Diffstat (limited to 'udevinfo.c')
-rw-r--r-- | udevinfo.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/udevinfo.c b/udevinfo.c index d0b1c447f4..be9aa769e1 100644 --- a/udevinfo.c +++ b/udevinfo.c @@ -79,6 +79,8 @@ static void print_all_attributes(const char *devpath, const char *key) if (attr_value == NULL) continue; len = strlcpy(value, attr_value, sizeof(value)); + if(len >= sizeof(value)) + len = sizeof(value) - 1; dbg("attr '%s'='%s'(%zi)", dent->d_name, value, len); /* remove trailing newlines */ |