1a213bd0a224384e02c2efa5f2dbb9130515dc82 angie Fri Jun 26 17:18:55 2015 -0700 Oops, using sizeof instead of ArraySize was causing a SEGV when pasting bogus text with more than 5 words per line into the user regions box. diff --git src/hg/lib/userRegions.c src/hg/lib/userRegions.c index 5a335e9..6795cd0 100644 --- src/hg/lib/userRegions.c +++ src/hg/lib/userRegions.c @@ -43,31 +43,31 @@ int regionCount = 0; int errCount = 0; struct bed4 *bedList = NULL; struct lineFile *lf = lineFileOnString("userData", TRUE, inputString); char *line = NULL; while (lineFileNextReal(lf, &line)) { char *chromName = NULL; int chromStart = 0; int chromEnd = 0; char *regionName = NULL; // Chop a copy of line so we can display line if there's an error. char copy[strlen(line)+1]; safecpy(copy, sizeof(copy), line); char *words[5]; - int wordCount = chopByWhite(copy, words, sizeof(words)); + int wordCount = chopByWhite(copy, words, ArraySize(words)); boolean badFormat = FALSE; boolean gotError = FALSE; /* might be something of the form: chrom:start-end optionalRegionName */ if (((1 == wordCount) || (2 == wordCount)) && hgParseChromRange(NULL, words[0], &chromName, &chromStart, &chromEnd)) { if (2 == wordCount) regionName = cloneString(words[1]); } else if (!((3 == wordCount) || (4 == wordCount))) { dyStringPrintf(dyWarn, "line %d: '%s': " "unrecognized format. Please enter 3- or 4-column BED or " "a chr:start-end position range optionally followed by a name.\n",