diff options
author | 2019-01-14 00:59:19 +0000 | |
---|---|---|
committer | 2019-01-14 00:59:19 +0000 | |
commit | 0dd2a5d5b0b2eefed9732e1db44e78a857efc6ff (patch) | |
tree | d6e9416846ec3b0b1a1e2e227c359f5aa96bfdaa | |
parent | Skip open of "network" ttys because they permanently retain the (large) (diff) | |
download | wireguard-openbsd-0dd2a5d5b0b2eefed9732e1db44e78a857efc6ff.tar.xz wireguard-openbsd-0dd2a5d5b0b2eefed9732e1db44e78a857efc6ff.zip |
do not peek before the beginning of a string
ok deraadt schwarze tb
-rw-r--r-- | bin/ksh/mail.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/mail.c b/bin/ksh/mail.c index 570722d57bc..e97bff6b33e 100644 --- a/bin/ksh/mail.c +++ b/bin/ksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.25 2019/01/07 20:50:43 tedu Exp $ */ +/* $OpenBSD: mail.c,v 1.26 2019/01/14 00:59:19 tedu Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -128,7 +128,7 @@ mpset(char *mptoparse) /* POSIX/bourne-shell say file%message */ for (p = mpath; (mmsg = strchr(p, '%')); ) { /* a literal percent? (POSIXism) */ - if (mmsg[-1] == '\\') { + if (mmsg > mpath && mmsg[-1] == '\\') { /* use memmove() to avoid overlap problems */ memmove(mmsg - 1, mmsg, strlen(mmsg) + 1); p = mmsg + 1; |