Skip to content

Commit

Permalink
[IA64] hpsim: Fix check for overlong simscsi prefix.
Browse files Browse the repository at this point in the history
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: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Chen Gang authored and Tony Luck committed Jun 3, 2013
1 parent d5e660b commit 69cbc04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/ia64/hp/sim/simscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ simscsi_setup (char *s)
if (strlen(s) > MAX_ROOT_LEN) {
printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
simscsi_root);
}
simscsi_root = s;
} else
simscsi_root = s;
return 1;
}

Expand Down

0 comments on commit 69cbc04

Please sign in to comment.