mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Kilroy <kilroyd@googlemail.com>
To: linux-kernel@vger.kernel.org, greg@kroah.com
Cc: pe1dnn@amsat.org, David Kilroy <kilroyd@googlemail.com>
Subject: [PATCH 2/4] staging: wlags49_h2: Stop playing with length in GIWESSID handler
Date: Sun, 25 Sep 2011 08:30:19 +0100	[thread overview]
Message-ID: <1316935821-6980-3-git-send-email-kilroyd@googlemail.com> (raw)
In-Reply-To: <1316935821-6980-1-git-send-email-kilroyd@googlemail.com>

WE21 clarified that ESSID should not be NULL terminated.
The existing code didn't NULL terminate, but did play with length
and then reset it again. Just stop it.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
---
 drivers/staging/wlags49_h2/wl_wext.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c
index 80bd938..1f6b4dc 100644
--- a/drivers/staging/wlags49_h2/wl_wext.c
+++ b/drivers/staging/wlags49_h2/wl_wext.c
@@ -1042,9 +1042,6 @@ static int wireless_get_essid(struct net_device *dev, struct iw_request_info *in
 		/* Copy the information into the user buffer */
 		data->length = pName->length;
 
-		/* NOTE: Null terminating is necessary for proper display of the SSID in
-		   the wireless tools */
-		data->length = pName->length + 1;
 		if( pName->length < HCF_MAX_NAME_LEN ) {
 			pName->name[pName->length] = '\0';
 		}
@@ -1070,11 +1067,7 @@ static int wireless_get_essid(struct net_device *dev, struct iw_request_info *in
 				pName->length = CNV_LITTLE_TO_INT( pName->length );
 
 				/* Copy the information into the user buffer */
-				data->length = pName->length + 1;
-				if( pName->length < HCF_MAX_NAME_LEN ) {
-					pName->name[pName->length] = '\0';
-				}
-
+				data->length = pName->length;
 				data->flags = 1;
 			} else {
 				ret = -EFAULT;
@@ -1084,8 +1077,6 @@ static int wireless_get_essid(struct net_device *dev, struct iw_request_info *in
 
 #endif // HCF_STA
 
-		data->length--;
-
 		if (pName->length > IW_ESSID_MAX_SIZE) {
 			ret = -EFAULT;
 			goto out_unlock;
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-25  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-25  7:30 [PATCH 0/4] staging: wlags49_h2: WEXT cleanups David Kilroy
2011-09-25  7:30 ` [PATCH 1/4] staging: wlags49_h2: Fixup WEXT capabilities David Kilroy
2011-09-25  7:30 ` David Kilroy [this message]
2011-09-25  7:30 ` [PATCH 3/4] staging: wlags49_h2: Declare support for WEXT 21 David Kilroy
2011-09-25  7:30 ` [PATCH 4/4] staging: wlags49_h2: Use IW_HANDLER macro David Kilroy
2011-09-25  9:54 ` [PATCH 0/4] staging: wlags49_h2: WEXT cleanups Henk de Groot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316935821-6980-3-git-send-email-kilroyd@googlemail.com \
    --to=kilroyd@googlemail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pe1dnn@amsat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®