mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
s390/dcss: array index 'i' is used before limits check.
Avoid out-of-bounds-read by checking count before indexing. Signed-off-by : Ameen Ali <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
This commit is contained in:
parent
a13ccb04af
commit
3a9f9183bd
1 changed files with 1 additions and 1 deletions
|
|
@ -547,7 +547,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
|
|||
* parse input
|
||||
*/
|
||||
num_of_segments = 0;
|
||||
for (i = 0; ((buf[i] != '\0') && (buf[i] != '\n') && i < count); i++) {
|
||||
for (i = 0; (i < count && (buf[i] != '\0') && (buf[i] != '\n')); i++) {
|
||||
for (j = i; (buf[j] != ':') &&
|
||||
(buf[j] != '\0') &&
|
||||
(buf[j] != '\n') &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue