From: Bill Pemberton Date: Mon, 24 Sep 2012 21:02:08 +0000 (-0400) Subject: staging: dgrp: fix potential call to strncpy with a negative number X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~74^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad0c6e367ee0d08c4caa19ad0dbd3d752bd39de0;p=pandora-kernel.git staging: dgrp: fix potential call to strncpy with a negative number In dgrp_receive() there is: desclen = ((plen - 12) > MAX_DESC_LEN) ? MAX_DESC_LEN : plen - 12; strncpy(nd->nd_ps_desc, b + 12, desclen); However, it's possible for plen to be <= 12 here so we'd be passing a negative number into the strncpy(). Fix this to not make the strncpy call and report an error if desclen is <= 0 Reported-by: Dan Carpenter Signed-off-by: Bill Pemberton Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed