Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 54288 invoked by uid 500); 28 Jan 2003 00:59:45 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 54262 invoked from network); 28 Jan 2003 00:59:44 -0000 Date: 28 Jan 2003 00:59:43 -0000 Message-ID: <20030128005943.94753.qmail@icarus.apache.org> From: bnicholes@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/file_io/win32 filepath.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bnicholes 2003/01/27 16:59:43 Modified: file_io/win32 filepath.c Log: Added a check to make sure that the path is not too long. Otherwise, just bail out. Revision Changes Path 1.38 +9 -6 apr/file_io/win32/filepath.c Index: filepath.c =================================================================== RCS file: /home/cvs/apr/file_io/win32/filepath.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- filepath.c 9 Jan 2003 16:21:53 -0000 1.37 +++ filepath.c 28 Jan 2003 00:59:43 -0000 1.38 @@ -83,10 +83,9 @@ char *newpath; #ifdef NETWARE char seperator[2] = { 0, 0}; - char server[MAX_SERVER_NAME+1]; - char volume[MAX_VOLUME_NAME+1]; - char path[MAX_PATH_NAME+1]; - char file[MAX_FILE_NAME+1]; + char server[APR_PATH_MAX+1]; + char volume[APR_PATH_MAX+1]; + char file[APR_PATH_MAX+1]; char *volsep = NULL; int elements; @@ -95,18 +94,22 @@ else return APR_EBADPATH; + if (strlen(*inpath) > APR_PATH_MAX) { + return APR_EBADPATH; + } + seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/'; /* Allocate and initialize each of the segment buffers */ - server[0] = volume[0] = path[0] = file[0] = '\0'; + server[0] = volume[0] = file[0] = '\0'; /* If we don't have a volume separator then don't bother deconstructing the path since we won't use the deconstructed information anyway. */ if (volsep) { /* Split the inpath into its separate parts. */ - deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF); + deconstruct(testpath, server, volume, NULL, file, NULL, &elements, PATH_UNDEF); /* If we got a volume part then continue splitting out the root. Otherwise we either have an incomplete or relative path