Skip to content

Commit

Permalink
ide: do_identify() string termination fix
Browse files Browse the repository at this point in the history
Terminates id->model string before invoking strstr() in do_identify().

Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
Tejun Heo authored and bzolnier committed Nov 5, 2007
1 parent afda5e4 commit 699b052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,12 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap);
ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap);

/* we depend on this a lot! */
id->model[sizeof(id->model)-1] = '\0';

if (strstr(id->model, "E X A B Y T E N E S T"))
goto err_misc;

/* we depend on this a lot! */
id->model[sizeof(id->model)-1] = '\0';
printk("%s: %s, ", drive->name, id->model);
drive->present = 1;
drive->dead = 0;
Expand Down

0 comments on commit 699b052

Please sign in to comment.