Skip to content

Commit df3c423

Browse files
committed
src: copy hier path to separate strin before hashing. SHALib modifies const result on some platforms.
1 parent 7c580f3 commit df3c423

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cov/cov-report.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1332,9 +1332,10 @@ static char *cover_get_report_name(const char *in)
13321332
SHA1_CTX ctx;
13331333
unsigned char buf[SHA1_LEN];
13341334
char *rv = xcalloc(2 * SHA1_LEN + 1);
1335+
char *in_cpy LOCAL = xstrdup(in);
13351336

13361337
SHA1Init(&ctx);
1337-
SHA1Update(&ctx, (const char unsigned*)in, strlen(in));
1338+
SHA1Update(&ctx, (const char unsigned*)in_cpy, strlen(in_cpy));
13381339
SHA1Final(buf, &ctx);
13391340

13401341
for (int i = 0; i < SHA1_LEN; i++)

0 commit comments

Comments
 (0)