pwrap: Use PSO_COPY_READ_SIZE in pso_copy()
authorAndreas Schneider <asn@samba.org>
Tue, 24 Mar 2020 10:19:36 +0000 (11:19 +0100)
committerAndreas Schneider <asn@samba.org>
Tue, 24 Mar 2020 10:20:03 +0000 (11:20 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
src/pam_wrapper.c

index 357e09c4ea0efee38e0e89a3ce8d628fe52e7447..fda7ff2f5dfa249552ae99e69f02996776413013 100644 (file)
@@ -994,9 +994,9 @@ static int pso_copy(const char *src, const char *dst, const char *pdir, mode_t m
                }
 
                if (found_slash && bread == PSO_COPY_READ_SIZE) {
-                       cmp = memcmp(buf, "etc/pam.d", 9);
+                       cmp = memcmp(buf, "etc/pam.d", PSO_COPY_READ_SIZE);
                        if (cmp == 0) {
-                               memcpy(buf, pdir + 1, 9);
+                               memcpy(buf, pdir + 1, PSO_COPY_READ_SIZE);
                        }
                        found_slash = false;
                }