e81403a315a24af601884b8a19e89bcecc92f267 galt Sat Dec 8 20:04:28 2018 -0800 Fixing hFindSplitTable and its use. Standard size, give real string size so no undetected overflows. Test result and abort if not found. Avoids SQL errors that otherwise will popup. Handles uninitialzed stack better for the output name. refs #22596. diff --git src/hg/hgTracks/rmskJoinedTrack.c src/hg/hgTracks/rmskJoinedTrack.c index 0756849..aee7709 100644 --- src/hg/hgTracks/rmskJoinedTrack.c +++ src/hg/hgTracks/rmskJoinedTrack.c @@ -1147,38 +1147,38 @@ x1 = max(x1, 0); x2 = roundingScale(blockEnd - winStart, width, baseWidth) + xOff; w = x2 - x1; if (w <= 0) w = 1; hvGfxBox(hvg, x1, ri->yOffset, w, heightPer, col); } } rmskJoinedFree(&ro); } freeHash(&hash); } else { - char table[64]; + char table[HDB_MAX_TABLE_STRING]; boolean hasBin; struct dyString *query = newDyString(1024); /* * Do black and white on single track. Fetch less than * we need from database. */ - if (hFindSplitTable(database, chromName, tg->table, table, &hasBin)) + if (hFindSplitTable(database, chromName, tg->table, table, sizeof table, &hasBin)) { sqlDyStringPrintf(query, "select chromStart,blockCount,blockSizes," "blockRelStarts from %s where ", table); if (hasBin) hAddBinToQuery(winStart, winEnd, query); sqlDyStringPrintf(query, "chromStart<%u and chromEnd>%u ", winEnd, winStart); /* * if we're using a single rmsk table, add chrom to the where clause */ if (startsWith("rmskJoined", table)) sqlDyStringPrintf(query, " and chrom = '%s' ", chromName); sr = sqlGetResult(conn, query->string); while ((row = sqlNextRow(sr)) != NULL)