Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69cbc046 authored by Chen Gang's avatar Chen Gang Committed by Tony Luck
Browse files

[IA64] hpsim: Fix check for overlong simscsi prefix.



When "strlen(s) > MAX_ROOT_LEN", it has already said to use the default
value, but in fact, it still use the input value.

If happens, next sprintf() for 'fname' in simscsi_queuecommand_lck()
may be memory overflow.

Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent d5e660ba
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -88,7 +88,7 @@ simscsi_setup (char *s)
	if (strlen(s) > MAX_ROOT_LEN) {
	if (strlen(s) > MAX_ROOT_LEN) {
		printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
		printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
		       simscsi_root);
		       simscsi_root);
	}
	} else
		simscsi_root = s;
		simscsi_root = s;
	return 1;
	return 1;
}
}