From 917131a2cf50cb85d3614aa3ce8467c9ed339448 Mon Sep 17 00:00:00 2001 From: he Date: Tue, 16 Oct 2007 15:37:32 +0000 Subject: [PATCH] When checking for the length of the user name, check against the size of the correct field. Fix provided by Bernhard Moellemann in PR#37137. --- dist/smbfs/lib/smb/ctx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/smbfs/lib/smb/ctx.c b/dist/smbfs/lib/smb/ctx.c index 1c6e959845db..6501ef475457 100644 --- a/dist/smbfs/lib/smb/ctx.c +++ b/dist/smbfs/lib/smb/ctx.c @@ -33,7 +33,7 @@ */ #include -__RCSID("$NetBSD: ctx.c,v 1.11 2006/05/02 10:09:18 tron Exp $"); +__RCSID("$NetBSD: ctx.c,v 1.12 2007/10/16 15:37:32 he Exp $"); #include #include @@ -312,7 +312,7 @@ smb_ctx_setserver(struct smb_ctx *ctx, const char *name) int smb_ctx_setuser(struct smb_ctx *ctx, const char *name) { - if (strlen(name) >= sizeof(ctx->ct_ssn.ioc_srvname)) { + if (strlen(name) >= sizeof(ctx->ct_ssn.ioc_user)) { smb_error("user name '%s' too long", 0, name); return ENAMETOOLONG; }