e28cc42abe8dbb30decf688ad7be6d593fcc8b75 hiram Tue Apr 30 15:56:20 2019 -0700 adding extraneous argument checks for all functions to cause error refs #18869 diff --git src/hg/hubApi/getData.c src/hg/hubApi/getData.c index e3c20a2..c83c113 100644 --- src/hg/hubApi/getData.c +++ src/hg/hubApi/getData.c @@ -911,36 +911,44 @@ if (fragEnd > fragStart) apiErrAbort(err400, err400Msg, "can not find sequence for chrom=%s;start=%s;end=%s for endpoint '/getData/sequence?genome=%s;chrom=%s;start=%s;end=%s' give hubUrl='%s'", chrom, start, end, genome, chrom, start, end, hubUrl); else apiErrAbort(err400, err400Msg, "can not find sequence for chrom=%s for endpoint '/getData/sequence?genome=%s;chrom=%s' give hubUrl='%s'", chrom, genome, chrom, hubUrl); } jsonWriteString(jw, "dna", seq->dna); apiFinishOutput(0, NULL, jw); } void apiGetData(char *words[MAX_PATH_INFO]) /* 'getData' function, words[1] is the subCommand */ { char *hubUrl = cgiOptionalString("hubUrl"); if (sameWord("track", words[1])) { + char *extraArgs = verifyLegalArgs("genome;hubUrl;track;chrom;start;end;maxItemsOutput;jsonOutputArrays"); + if (extraArgs) + apiErrAbort(err400, err400Msg, "extraneous arguments found for function /getData/track '%s'", extraArgs); + if (isNotEmpty(hubUrl)) getHubTrackData(hubUrl); else getTrackData(); } else if (sameWord("sequence", words[1])) { + char *extraArgs = verifyLegalArgs("genome;hubUrl;track;chrom;start;end"); + if (extraArgs) + apiErrAbort(err400, err400Msg, "extraneous arguments found for function /getData/sequence '%s'", extraArgs); + if (isNotEmpty(hubUrl)) getHubSequenceData(hubUrl); else { char *db = cgiOptionalString("genome"); if (isEmpty(db)) apiErrAbort(err400, err400Msg, "missing URL genome= name for endpoint '/getData/sequence"); /* existence of db has already been proven before getting here */ getSequenceData(db, NULL); } } else apiErrAbort(err400, err400Msg, "do not recognize endpoint function: '/%s/%s'", words[0], words[1]); }