diff options
author | Joe Marcus Clarke <marcus@freedesktop.org> | 2008-09-04 22:13:30 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2008-09-04 22:13:30 -0400 |
commit | 3564e5cbe4d9c0538d6eb519904ef0befab39d75 (patch) | |
tree | f2058d485f13e11540d790de6052db2b9441983b /dbus/dbus-sysdeps-unix.c | |
parent | 9680c283586d7165e7482db8c3dcaf2d03e2f0b6 (diff) |
Bug 17061: Handle error return from sysconf correctly
* dbus/dbus-sysdeps-unix.c:
* dbus/dbus-sysdeps-util-unix.c: Cast return
from sysconf temporarily so we actually see
-1.
Signed-off-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 3f963bca..24a3774f 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1493,7 +1493,11 @@ fill_user_info (DBusUserInfo *info, /* retrieve maximum needed size for buf */ buflen = sysconf (_SC_GETPW_R_SIZE_MAX); - if (buflen <= 0) + /* sysconf actually returns a long, but everything else expects size_t, + * so just recast here. + * https://bugs.freedesktop.org/show_bug.cgi?id=17061 + */ + if ((long) buflen <= 0) buflen = 1024; result = -1; |