90dc829b2d87b15c4fc4bbc1d814f83d1274ef52 braney Fri Sep 4 14:00:05 2026 -0700 Pass element counts, not byte sizes, to the chop routines chopByWhite, chopString and chopByChar take their last argument as a count of elements in the output array. Fifteen call sites passed sizeof(array) instead. For an array of pointers that is eight times the real capacity on a 64-bit build, so the chop could write well past the end of the array. Switched each to ArraySize(). Behaviour is unchanged for any input that already fitted in the array. Built clean: lib, hg/lib, hg/hgTracks, hg/hgc, hg/utils/hubCheck, utils/bedScore, parasol/lib, parasol/parasol. Three directories do not build, but they fail the same way without this change: checkExp is missing htslib link flags, and cgapSageFind and affySplice have stale prototypes in files this does not touch. Co-Authored-By: Claude Opus 5 (1M context) diff --git src/hg/makeDb/outside/hgGtex/hgGtex.c src/hg/makeDb/outside/hgGtex/hgGtex.c index 220b0d9029c..a0ea6ae074d 100644 --- src/hg/makeDb/outside/hgGtex/hgGtex.c +++ src/hg/makeDb/outside/hgGtex/hgGtex.c @@ -551,31 +551,31 @@ fprintf(tissueMedianMaleFile, "\n"); verbose(3, "max median: %0.3f\n", maxMedian); if (maxScoreRet) *maxScoreRet = maxScore; if (maxMedianRet) *maxMedianRet = maxMedian; } /****************************/ /* Deal with tissues */ char *makeTissueName(char *description) /* Create a single word camel-case name from a tissue description */ { char *words[10]; -int count = chopByWhite(cloneString(description), words, sizeof(words)); +int count = chopByWhite(cloneString(description), words, ArraySize(words)); struct dyString *ds = dyStringNew(0); int i; for (i=0; i