diff options
author | Richard Levitte <richard@levitte.org> | 2014-08-15 01:24:34 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2014-09-03 22:23:34 +0200 |
commit | a91b73fd29493135f248a48b534742436bf89146 (patch) | |
tree | 5c462b26b42177b0ccf32a513f4c326727a8df8b /crypto/LPdir_vms.c | |
parent | 02c38e37a681e2e6e665531c72edaab2b002cf84 (diff) |
Followup on RT3334 fix: make sure that a directory that's the empty
string returns 0 with errno = ENOENT.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 360928b7d0f16dde70e26841bbf9e1af727e8b8f)
Diffstat (limited to 'crypto/LPdir_vms.c')
-rw-r--r-- | crypto/LPdir_vms.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/LPdir_vms.c b/crypto/LPdir_vms.c index 7613bd254e..3582fa6f01 100644 --- a/crypto/LPdir_vms.c +++ b/crypto/LPdir_vms.c @@ -1,4 +1,3 @@ -/* $LP: LPlib/source/LPdir_vms.c,v 1.20 2004/08/26 13:36:05 _cvs_levitte Exp $ */ /* * Copyright (c) 2004, Richard Levitte <richard@levitte.org> * All rights reserved. @@ -88,6 +87,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) size_t filespeclen = strlen(directory); char *filespec = NULL; + if (filespeclen == 0) + { + errno = ENOENT; + return 0; + } + /* MUST be a VMS directory specification! Let's estimate if it is. */ if (directory[filespeclen-1] != ']' && directory[filespeclen-1] != '>' |