From: Rich Felker Date: Thu, 21 Feb 2013 04:01:22 +0000 (-0500) Subject: use memcmp instead of str[n]cmp for temp function XXXXXX checking X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=8872e4e481d8702e68641605bba279796646773d use memcmp instead of str[n]cmp for temp function XXXXXX checking --- diff --git a/src/temp/mkostemps.c b/src/temp/mkostemps.c index d87d4b66..8cc01e37 100644 --- a/src/temp/mkostemps.c +++ b/src/temp/mkostemps.c @@ -10,7 +10,7 @@ char *__randname(char *); int __mkostemps(char *template, int len, int flags) { size_t l = strlen(template); - if (l<6 || len>l-6 || strncmp(template+l-len-6, "XXXXXX", 6)) { + if (l<6 || len>l-6 || memcmp(template+l-len-6, "XXXXXX", 6)) { errno = EINVAL; return -1; } diff --git a/src/temp/mktemp.c b/src/temp/mktemp.c index de0f3709..24c858bb 100644 --- a/src/temp/mktemp.c +++ b/src/temp/mktemp.c @@ -11,7 +11,7 @@ char *__mktemp(char *template) size_t l = strlen(template); int retries = 10000; - if (l < 6 || strcmp(template+l-6, "XXXXXX")) { + if (l < 6 || memcmp(template+l-6, "XXXXXX", 6)) { errno = EINVAL; *template = 0; return template;