Commit 5079b95c authored by Joey Adams's avatar Joey Adams Committed by Rusty Russell

tools: Fixed unchecked *strrchr in a couple places.

tools/ccan_depends --compile ccan/module (without a trailing slash)
results in a segfault.
parent c67c37e8
......@@ -41,6 +41,7 @@ static void check_depends_exist(struct manifest *m,
char **deps;
char *updir = talloc_strdup(m, m->dir);
if (strrchr(updir, '/'))
*strrchr(updir, '/') = '\0';
if (safe_mode)
......
......@@ -59,6 +59,7 @@ static char *compile_info(const void *ctx, const char *dir)
return NULL;
ccandir = talloc_dirname(ctx, dir);
if (strrchr(ccandir, '/'))
*strrchr(ccandir, '/') = '\0';
compiled = maybe_temp_file(ctx, "", false, "info");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment