chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab7ab02
)
fix off-by-one in pass_env_to_socket()
author
Alan Jenkins
<alan-jenkins@tuffmail.co.uk>
Mon, 8 Sep 2008 22:48:17 +0000
(
00:48
+0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Mon, 8 Sep 2008 22:48:17 +0000
(
00:48
+0200)
udev/udev_rules.c
patch
|
blob
|
history
diff --git
a/udev/udev_rules.c
b/udev/udev_rules.c
index 004a89f748e0529bebe5e06ba7056544e40e9083..3b9631b883c67e98b07676dc3575f54d42dae2b8 100644
(file)
--- a/
udev/udev_rules.c
+++ b/
udev/udev_rules.c
@@
-486,10
+486,10
@@
static int pass_env_to_socket(struct udev *udev, const char *sockpath, const cha
saddrlen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&saddr.sun_path[1]);
}
saddrlen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&saddr.sun_path[1]);
}
- bufpos = snprintf(buf, sizeof(buf)
-1
, "%s@%s", action, devpath);
+ bufpos = snprintf(buf, sizeof(buf), "%s@%s", action, devpath);
bufpos++;
bufpos++;
- for (i = 0; environ[i] != NULL && bufpos < (sizeof(buf)
-1
); i++) {
- bufpos += strlcpy(&buf[bufpos], environ[i], sizeof(buf) - bufpos
-1
);
+ for (i = 0; environ[i] != NULL && bufpos < (sizeof(buf)); i++) {
+ bufpos += strlcpy(&buf[bufpos], environ[i], sizeof(buf) - bufpos);
bufpos++;
}
if (bufpos > sizeof(buf))
bufpos++;
}
if (bufpos > sizeof(buf))