summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_scannedonly.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-01-12 21:18:36 -0800
committerJeremy Allison <jra@samba.org>2010-01-12 21:18:36 -0800
commited457e07b9bdc0acda9dc52307d8bc2118f32f06 (patch)
treeefde94989cc193e1491d6eac1fa48c6ccc47515f /source3/modules/vfs_scannedonly.c
parent33ee8b5a4e390f9aa43cceeec137c0ed82171340 (diff)
downloadsamba-ed457e07b9bdc0acda9dc52307d8bc2118f32f06.tar.gz
samba-ed457e07b9bdc0acda9dc52307d8bc2118f32f06.tar.bz2
samba-ed457e07b9bdc0acda9dc52307d8bc2118f32f06.zip
Fix two uses of strncat -> strlcat. Ensure proper use of strncpy when setting socket name.
Jeremy.
Diffstat (limited to 'source3/modules/vfs_scannedonly.c')
-rw-r--r--source3/modules/vfs_scannedonly.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index 69958988ac..ff16d78c3f 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -200,7 +200,7 @@ static int connect_to_scanner(vfs_handle_struct * handle)
}
saun.sun_family = AF_UNIX;
strncpy(saun.sun_path, so->socketname,
- strlen(so->socketname) + 1);
+ sizeof(saun.sun_path) - 1);
if (connect(so->socket, (struct sockaddr *)(void *)&saun,
SUN_LEN(&saun)) < 0) {
DEBUG(2, ("failed to connect to socket %s\n",
@@ -323,8 +323,8 @@ static void notify_scanner(vfs_handle_struct * handle, const char *scanfile)
if (gsendlen + tmplen >= SENDBUFFERSIZE) {
flush_sendbuffer(handle);
}
- strncat(so->gsendbuffer, tmp, tmplen);
- strncat(so->gsendbuffer, "\n", 1);
+ strlcat(so->gsendbuffer, tmp, SENDBUFFERSIZE + 1);
+ strlcat(so->gsendbuffer, "\n", SENDBUFFERSIZE + 1);
}
static bool is_scannedonly_file(struct Tscannedonly *so, const char *shortname)