From 360928b7d0f16dde70e26841bbf9e1af727e8b8f Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 15 Aug 2014 01:24:34 +0200 Subject: Followup on RT3334 fix: make sure that a directory that's the empty string returns 0 with errno = ENOENT. Reviewed-by: Andy Polyakov --- crypto/LPdir_win.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crypto/LPdir_win.c') diff --git a/crypto/LPdir_win.c b/crypto/LPdir_win.c index 5cdcd001a7..d5b5e2c900 100644 --- a/crypto/LPdir_win.c +++ b/crypto/LPdir_win.c @@ -66,6 +66,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) char *extdirbuf = NULL; size_t dirlen = strlen (directory); + if (dirlen == 0) + { + errno = ENOENT; + return 0; + } + *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); if (*ctx == NULL) { -- cgit v1.2.3