summaryrefslogtreecommitdiffstats
path: root/net/irda/parameters.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-10-30 13:35:11 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-10-30 13:35:11 +0200
commit67577927e8d7a1f4b09b4992df640eadc6aacb36 (patch)
tree2e9efe6b5745965faf0dcc084d4613d9356263f9 /net/irda/parameters.c
parentMTD: Fix wrong check register_blkdev return value (diff)
parentMerge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 (diff)
downloadlinux-67577927e8d7a1f4b09b4992df640eadc6aacb36.tar.xz
linux-67577927e8d7a1f4b09b4992df640eadc6aacb36.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Conflicts: drivers/mtd/mtd_blkdevs.c Merge Grant's device-tree bits so that we can apply the subsequent fixes. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'net/irda/parameters.c')
-rw-r--r--net/irda/parameters.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/irda/parameters.c b/net/irda/parameters.c
index fc1a20565e2d..71cd38c1a67f 100644
--- a/net/irda/parameters.c
+++ b/net/irda/parameters.c
@@ -298,6 +298,8 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
p.pi = pi; /* In case handler needs to know */
p.pl = buf[1]; /* Extract length of value */
+ if (p.pl > 32)
+ p.pl = 32;
IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __func__,
p.pi, p.pl);
@@ -318,7 +320,7 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
(__u8) str[0], (__u8) str[1]);
/* Null terminate string */
- str[p.pl+1] = '\0';
+ str[p.pl] = '\0';
p.pv.c = str; /* Handler will need to take a copy */