From patchwork Fri Jun 17 10:31:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 891152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5HBIesc019766 for ; Fri, 17 Jun 2011 11:18:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756478Ab1FQKbe (ORCPT ); Fri, 17 Jun 2011 06:31:34 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:37045 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754650Ab1FQKbd (ORCPT ); Fri, 17 Jun 2011 06:31:33 -0400 Received: by pzk9 with SMTP id 9so1642916pzk.19 for ; Fri, 17 Jun 2011 03:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=GuOhpPQw01xQ8gLu7EbSKrwNiHK5c1VGLH0QAj5kwqs=; b=Ua73IpocAxFlhxA4ic42xamz0cYNK7/sPXLipophqukriaWaWBVE+jJovOwAdmqwiq hcdPEJlC3L/ne3BfVR+ToEJE++0sWADozxyfxWlRKpQSqAJ6m1VCOLl36i57RTZowZ5W O4rGtdAi3h7RPrs3w8jCf0XZ8Ot51Mg9zggyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=Si3aCarMgh+iyvf4hvsN83Blrxb96TF8W+18wn0YFVQp5B93SZFC8D8m1IcTjEI1dF Tj7W/MUvW+Sl0RpV6rHLJP+d+4BZybvEKr7+1SFDTIY7+uqxAKsVPyGF/QlsbRR5CL0A dtDSzvwO313ikO4IdFrG2wKflAnboZCwQgChM= Received: by 10.68.0.168 with SMTP id 8mr900397pbf.214.1308306692684; Fri, 17 Jun 2011 03:31:32 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id p5sm1442886pbd.12.2011.06.17.03.31.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2011 03:31:32 -0700 (PDT) Date: Fri, 17 Jun 2011 13:31:01 +0300 From: Dan Carpenter To: Steve French Cc: "open list:COMMON INTERNET F..." , "open list:COMMON INTERNET F..." , kernel-janitors@vger.kernel.org Subject: [patch] cifs: update limit for snprintf() in cifs_construct_tcon() Message-ID: <20110617103059.GE2520@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 17 Jun 2011 11:18:41 +0000 (UTC) In 34c87901e113 "Shrink stack space usage in cifs_construct_tcon" we change the size of the username name buffer from MAX_USERNAME_SIZE (256) to 28. This call to snprintf() needs to be updated as well. Signed-off-by: Dan Carpenter --- I know that everyone is going to complain about using a literal but it's local to this function and it's commented in the lines above. I'm not opposed to using a define, I suppose, if you give me a good one, but really I'd just as soon leave it as is. *eye roll in advance*. -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 12cf72d..efd1c7a 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3451,7 +3451,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) goto out; } - snprintf(username, MAX_USERNAME_SIZE, "krb50x%x", fsuid); + snprintf(username, 28, "krb50x%x", fsuid); vol_info->username = username; vol_info->local_nls = cifs_sb->local_nls; vol_info->linux_uid = fsuid;