All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] cifs: update limit for snprintf() in cifs_construct_tcon()
@ 2011-06-17 10:31 ` Dan Carpenter
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2011-06-17 10:31 UTC (permalink / raw)
  To: Steve French
  Cc: open list:COMMON INTERNET F..., open list:COMMON INTERNET F...,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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 <error27@gmail.com>
---
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*.

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;

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-12 18:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 10:31 [patch] cifs: update limit for snprintf() in cifs_construct_tcon() Dan Carpenter
2011-06-17 10:31 ` Dan Carpenter
     [not found] ` <20110617103059.GE2520-z0WHZYlhLlzP0Z7Jsv878P8+0UxHXcjY@public.gmane.org>
2011-06-17 11:28   ` walter harms
2011-06-17 11:28     ` walter harms
2011-07-12 18:14   ` Steve French
2011-07-12 18:14     ` Steve French
2011-07-12 18:16     ` Jeremy Allison
     [not found]     ` <CAH2r5mu6TuWs6P8ZeR1=KCv8BLSu0_Z8b2uoVUqXhw55=39CWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-12 18:20       ` [patch] cifs: update limit for snprintf() in Dan Carpenter
2011-07-12 18:20         ` [patch] cifs: update limit for snprintf() in cifs_construct_tcon() Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.