aboutsummaryrefslogtreecommitdiffstats
path: root/src/libnsss/nsss_switch_shadow_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnsss/nsss_switch_shadow_read.c')
-rw-r--r--src/libnsss/nsss_switch_shadow_read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnsss/nsss_switch_shadow_read.c b/src/libnsss/nsss_switch_shadow_read.c
index 7d4c2a4..2bb4b7a 100644
--- a/src/libnsss/nsss_switch_shadow_read.c
+++ b/src/libnsss/nsss_switch_shadow_read.c
@@ -47,9 +47,9 @@ int nsss_switch_shadow_read (buffer *b, struct spwd *sp, stralloc *sa, tain cons
if (!buffer_timed_get(b, sa->s + sa->len, total, deadline, stamp)) return 0 ;
if (sa->s[sa->len + total - 1]) return (errno = EPROTO, 0) ;
p = sa->s + sa->len ; len = total ;
- sptmp.sp_namp = p ; x = strnlen(p, len) + 1 ; p += x ; len -= x ;
+ sptmp.sp_namp = p ; x = strnlen(p, len-1) + 1 ; p += x ; len -= x ;
if (!len) return (errno = EPROTO, 0) ;
- sptmp.sp_pwdp = p ; x = strnlen(p, len) + 1 ; p += x ; len -= x ;
+ sptmp.sp_pwdp = p ; x = strnlen(p, len-1) + 1 ; p += x ; len -= x ;
if (len) return (errno = EPROTO, 0) ;
sa->len += total ;
*sp = sptmp ;