Skip to contentSkip to conversation

cumana: Fix a long standing bogon

PATCH New Alan Cox 1 participant 1 message Mar 23, 2009

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 cumana: Fix a long standing bogon

Should be using strncmp as the data from user space may be unterminated

(Bug #8004)

---

 drivers/scsi/arm/cumana_2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/arm/cumana_2.c +1 -1
index 68a6412..ed502b7 100644
@@ -318,7 +318,7 @@ cumanascsi_2_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
 {
 	int ret = length;
 
-	if (length >= 11 && strcmp(buffer, "CUMANASCSI2") == 0) {
+	if (length >= 11 && strncmp(buffer, "CUMANASCSI2", 11) == 0) {
 		buffer += 11;
 		length -= 11;