diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2006-10-13 00:30:09 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2006-10-13 00:30:09 +0000 |
commit | d879b6d45e2562a15d3b158bb807ab2f18d43ebb (patch) | |
tree | 0b2a84a58dabcbcf97bb577ec8245110c680e070 /sys/dev/raidframe | |
parent | 4d7d8f4bd35609aa15209b40a61e4021663c73d9 (diff) |
Get rid of another potentially unsafe pattern of foo[strlen(foo) - 1] = ...
OK krw, deraadt
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r-- | sys/dev/raidframe/rf_disks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c index 1e9d36e9c5a..66afd87c22b 100644 --- a/sys/dev/raidframe/rf_disks.c +++ b/sys/dev/raidframe/rf_disks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_disks.c,v 1.10 2003/11/27 20:13:27 henning Exp $ */ +/* $OpenBSD: rf_disks.c,v 1.11 2006/10/13 00:30:08 cloder Exp $ */ /* $NetBSD: rf_disks.c,v 1.31 2000/06/02 01:17:14 oster Exp $ */ /* @@ -649,7 +649,7 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *buf, RF_RaidDisk_t *diskPtr, retcode = 0; p = rf_find_non_white(buf); - if (p[strlen(p) - 1] == '\n') { + if (*buf != '\0' && p[strlen(p) - 1] == '\n') { /* Strip off the newline. */ p[strlen(p) - 1] = '\0'; } |