diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2019-01-14 00:59:20 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2019-01-14 00:59:20 +0000 |
commit | b0c14eff41186cd1d0a015c2cac716618cb53e57 (patch) | |
tree | ce78b4452ce6a136962bc361be5b607cc3783066 /bin | |
parent | 0b02799653a61e952946e14ae55617141e8fa8c0 (diff) |
do not peek before the beginning of a string
ok deraadt schwarze tb
Diffstat (limited to 'bin')
-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; |