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) <noreply@anthropic.com> diff --git src/parasol/lib/paraMessage.c src/parasol/lib/paraMessage.c index 598fe202f47..ae6f600f800 100644 --- src/parasol/lib/paraMessage.c +++ src/parasol/lib/paraMessage.c @@ -332,31 +332,31 @@ struct paraMessage pm; struct paraMultiMessage pmm; char *row[256]; int count = 0; pmInitFromName(&pm, host, paraHubPortStr); /* ensure the multi-message response comes from the correct ip and has no duplicate msgs*/ pmmInit(&pmm, &pm); if (!pmSendStringWithRetries(&pm, ru, query)) noWarnAbort(); for (;;) { if (!pmmReceive(&pmm, ru)) break; if (pm.size == 0) break; - count = chopByChar(pm.data, '\n', row, sizeof(row)); + count = chopByChar(pm.data, '\n', row, ArraySize(row)); if (count > 1) --count; /* for multiline, count is inflated by one */ int i; for(i=0;i<count;++i) { slNameAddHead(&list, row[i]); } } rudpClose(&ru); slReverse(&list); return list; } struct paraPstat2Job *paraPstat2JobLoad(char **row) /* Turn an array of 5 strings into a paraPstat2Job. */