diff options
-rw-r--r-- | p11-kit/modules.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 4c87cee..c0a000a 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -263,9 +263,14 @@ build_path (const char *dir, const char *filename) assert (filename); len = snprintf (NULL, 0, "%s/%s", dir, filename) + 1; - if (len <= 0 || len > PATH_MAX) + if (len <= 0) return NULL; +#ifdef PATH_MAX + if (len > PATH_MAX) + return NULL; +#endif + if (!(path = malloc (len))) return NULL; |