diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-19 16:11:58 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-19 16:11:58 +0000 |
commit | 4a54a604a94e68045e1bd5889f8300dd98180020 (patch) | |
tree | 03b9d10a783face9904dc6c3a9cf1037ce95373e /src/util/service.c | |
parent | 5841f723a0ca4f808c380315e09d663d9e654b52 (diff) | |
download | gnunet-4a54a604a94e68045e1bd5889f8300dd98180020.tar.gz gnunet-4a54a604a94e68045e1bd5889f8300dd98180020.zip |
Added size check for unix path configs
Diffstat (limited to 'src/util/service.c')
-rw-r--r-- | src/util/service.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/service.c b/src/util/service.c index 3423b58cb..79b21e065 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -867,6 +867,14 @@ GNUNET_SERVICE_get_server_addresses (const char *serviceName, | |||
867 | &unixpath)); | 867 | &unixpath)); |
868 | 868 | ||
869 | /* probe UNIX support */ | 869 | /* probe UNIX support */ |
870 | struct sockaddr_un s_un; | ||
871 | if (strlen(unixpath) >= sizeof(s_un.sun_path)) | ||
872 | { | ||
873 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
874 | _("UNIXPATH `%s' too long, maximum length is %llu\n"),unixpath, sizeof(s_un.sun_path)); | ||
875 | } | ||
876 | /* FIXME: Perhaps add an assertion or a break??? */ | ||
877 | |||
870 | desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0); | 878 | desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0); |
871 | if (NULL == desc) | 879 | if (NULL == desc) |
872 | { | 880 | { |