Fix segfault if distfetch and distextract binaries are run standalone
without the DISTRIBUTIONS environment variable set. PR: bin/165492 Submitted by: Fernando Apesteguia MFC after: 4 days
This commit is contained in:
parent
2f42a9bf0d
commit
bfd258f74e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232200
@ -38,9 +38,16 @@ static int extract_files(int nfiles, const char **files);
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
char *diststring = strdup(getenv("DISTRIBUTIONS"));
|
||||
char *diststring;
|
||||
const char **dists;
|
||||
int i, retval, ndists = 0;
|
||||
|
||||
if (getenv("DISTRIBUTIONS") == NULL) {
|
||||
fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
diststring = strdup(getenv("DISTRIBUTIONS"));
|
||||
for (i = 0; diststring[i] != 0; i++)
|
||||
if (isspace(diststring[i]) && !isspace(diststring[i+1]))
|
||||
ndists++;
|
||||
|
@ -37,9 +37,16 @@ static int fetch_files(int nfiles, char **urls);
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
char *diststring = strdup(getenv("DISTRIBUTIONS"));
|
||||
char *diststring;
|
||||
char **urls;
|
||||
int i, nfetched, ndists = 0;
|
||||
|
||||
if (getenv("DISTRIBUTIONS") == NULL) {
|
||||
fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
diststring = strdup(getenv("DISTRIBUTIONS"));
|
||||
for (i = 0; diststring[i] != 0; i++)
|
||||
if (isspace(diststring[i]) && !isspace(diststring[i+1]))
|
||||
ndists++;
|
||||
|
Loading…
Reference in New Issue
Block a user