pwrap: Make sure we have a terminating null byte
authorAndreas Schneider <asn@samba.org>
Fri, 15 Jan 2016 10:44:14 +0000 (11:44 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 18 Jan 2016 09:36:20 +0000 (10:36 +0100)
This is just to silence Coverity.

CID: 47508

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
src/pam_wrapper.c

index a388b29f131db646a452fcb1b08eb6c6a9e65f92..4b9a72be072b0797caf8dc2d8717926158679e7b 100644 (file)
@@ -899,6 +899,7 @@ static void pwrap_init(void)
                char *dname;
 
                strncpy(libpam_path_cp, libpam_path, sizeof(libpam_path_cp));
+               libpam_path_cp[sizeof(libpam_path_cp) - 1] = '\0';
 
                dname = dirname(libpam_path_cp);
                if (dname == NULL) {