summaryrefslogtreecommitdiff
path: root/src/udev/libudev-util-private.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/libudev-util-private.c')
-rw-r--r--src/udev/libudev-util-private.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/libudev-util-private.c b/src/udev/libudev-util-private.c
index 08f0ba2228..f764ab4d8b 100644
--- a/src/udev/libudev-util-private.c
+++ b/src/udev/libudev-util-private.c
@@ -116,11 +116,11 @@ int util_delete_path(struct udev *udev, const char *path)
uid_t util_lookup_user(struct udev *udev, const char *user)
{
char *endptr;
- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
- char buf[buflen];
struct passwd pwbuf;
struct passwd *pw;
uid_t uid;
+ size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ char *buf = alloca(buflen);
if (strcmp(user, "root") == 0)
return 0;
@@ -141,11 +141,11 @@ uid_t util_lookup_user(struct udev *udev, const char *user)
gid_t util_lookup_group(struct udev *udev, const char *group)
{
char *endptr;
- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- char *buf;
struct group grbuf;
struct group *gr;
gid_t gid = 0;
+ size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ char *buf = alloca(buflen);
if (strcmp(group, "root") == 0)
return 0;