files.c (addFile): reassure that file path starts with '/'

This commit is contained in:
Alexey Tourbin 2008-03-25 04:40:21 +03:00
parent b842bf5b4a
commit bbcc1b2fe2

View File

@ -1545,6 +1545,14 @@ static int addFile(FileList fl, const char * diskURL,
fileURL = "/";
/*@=branchstate@*/
/* cannot happen?! */
if (*fileURL != '/') {
rpmError(RPMERR_BADSPEC,
_("File must begin with \"/\": %s\n"), fileURL);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
/* If we are using a prefix, validate the file */
if (!fl->inFtw && fl->prefix) {
const char *prefixTest;