diff options
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/ads_struct.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index b6c8e995ed..e6220fd320 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -52,10 +52,17 @@ char *ads_build_path(const char *realm, const char *sep, const char *field, int return NULL; } - strlcpy(ret,field, len); + if (strlcpy(ret,field, len) >= len) { + /* Truncate ! */ + free(r); + return NULL; + } p=strtok_r(r, sep, &saveptr); if (p) { - strlcat(ret, p, len); + if (strlcat(ret, p, len) >= len) { + free(r); + return NULL; + } while ((p=strtok_r(NULL, sep, &saveptr)) != NULL) { int retval; |