summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Le Bihan <eric.le.bihan.dev@free.fr>2016-08-09 16:48:47 (GMT)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-08-10 16:39:15 (GMT)
commitc61570ac32f052e050c46838ea5ab60de5836f8e (patch)
treed627921b38b662b82e8c388ec1c0b4c24f1ed2e5
parentbbd7151f7980c7d075fe652331f01d3aadc73e42 (diff)
librt: fix path parsing in __spawni()
__spawni() loops forever when parsing the path variable due to incorrect pointer update. This patch fixes the issue. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
-rw-r--r--librt/spawn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/librt/spawn.c b/librt/spawn.c
index 79f5b06..25e3994 100644
--- a/librt/spawn.c
+++ b/librt/spawn.c
@@ -203,9 +203,10 @@ __spawni(pid_t *pid, const char *file,
*--name = '/';
}
- char *p;
+ char *p = (char *)path;
do {
char *startp;
+ path = p;
p = strchrnul(path, ':');
/* Two adjacent colons, or a colon at the beginning or the end
@@ -233,7 +234,6 @@ __spawni(pid_t *pid, const char *file,
goto error;
}
- path = p;
} while (*p++ != '\0');
error: