summaryrefslogtreecommitdiff
path: root/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-11-28 09:37:47 +0100
committerDavid Disseldorp <ddiss@samba.org>2013-11-28 14:33:32 +0100
commitffae8a13b62433e5b74f1bc317db6c9979718cbb (patch)
treedffd8305ca41aa19ed22f84408695883e0bd959e /nsswitch/pam_winbind.c
parent13550a2b5eed57084a5d9671d9493a9a2e08d7e3 (diff)
downloadsamba-ffae8a13b62433e5b74f1bc317db6c9979718cbb.tar.gz
pam_winbind: Use strlcat in safe_append_string
We have that available via libreplace, so use it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Nov 28 14:33:32 CET 2013 on sn-devel-104
Diffstat (limited to 'nsswitch/pam_winbind.c')
-rw-r--r--nsswitch/pam_winbind.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 2e37662959c..9322971bd3f 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -1043,15 +1043,9 @@ static bool safe_append_string(char *dest,
const char *src,
int dest_buffer_size)
{
- int dest_length = strlen(dest);
- int src_length = strlen(src);
-
- if (dest_length + src_length + 1 > dest_buffer_size) {
- return false;
- }
-
- memcpy(dest + dest_length, src, src_length + 1);
- return true;
+ size_t len;
+ len = strlcat(dest, src, dest_buffer_size);
+ return (len < dest_buffer_size);
}
/**