diff options
author | 2015-07-28 14:08:52 +0000 | |
---|---|---|
committer | 2015-07-28 14:08:52 +0000 | |
commit | 9aa912489179aac91010ec9b51b005b26e4475be (patch) | |
tree | 0f4d868400b305b364bc478d2c3fa8ae18819860 | |
parent | make -B with bad checksums cope. Reported by millert@ (diff) | |
download | wireguard-openbsd-9aa912489179aac91010ec9b51b005b26e4475be.tar.xz wireguard-openbsd-9aa912489179aac91010ec9b51b005b26e4475be.zip |
Fix keepenv handling. Initially reported by Ze Loff on misc@.
tedu@ agrees.
-rw-r--r-- | usr.bin/doas/doas.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c index 0c16f17efc5..70456d725b2 100644 --- a/usr.bin/doas/doas.c +++ b/usr.bin/doas/doas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: doas.c,v 1.28 2015/07/27 15:38:11 espie Exp $ */ +/* $OpenBSD: doas.c,v 1.29 2015/07/28 14:08:52 zhuk Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -256,8 +256,10 @@ copyenv(const char **oldenvp, struct rule *rule) size_t j; for (j = 0; j < nextras; j++) { if (strcmp(extra[j], safeset[i]) == 0) { - extra[j--] = extra[nextras--]; + nextras--; + extra[j] = extra[nextras]; extra[nextras] = NULL; + j--; } } } |