cec5ead054791f2a6601f308a56d280c08bd8ef7
braney
  Fri Sep 4 13:32:36 2026 -0700
quickLift: do not take the lift path on half a pair of settings

A hub can set quickLiftDb without setting quickLiftUrl, and nothing filters hub
trackDb settings.  The alignment loaders gated on quickLiftDb alone, so such a
stanza took the lift path with no chain file and hgTracks died in
endsWith(NULL, ".bb") from bigChainGetLinkFile, by way of quickLiftLoadChains.
Verified: SIGSEGV in strlen from common.c:1653, page truncated mid-HTML.  This is
reachable on a production browser now that bigChain and bigMaf are liftable,
because those carry their own bigDataUrl and so need no trustTrackDb.

quickLiftIsLifted requires both halves, and every gate now uses it, which also
settles the two different predicates that were in use for the same question.
quickLiftLoadChains returns an empty list for a NULL file as well, so the older
bed and genePred callers are covered whatever their gate does.

quickLiftSql now checks that a row has at least as many columns as the loader is
going to read.  The native psl loader has always checked this, and the quickLift
path replacing it did not, so a table of the wrong type walked off the end of the
row; the psl caller now states the 21 columns it needs.

quickLiftMafs held a maf component name in a fixed buffer through safecpy, which
aborts rather than truncates, so a long name from a hub took hgTracks down.  It
clones instead.

htcBigPslAliInWindow used a trackDb pointer its lookup can leave NULL, which its
sibling htcBigPslAli already checked for.  And aliTrackParam formats a URL
parameter into a fixed buffer with safef, which aborts on a long one.

refs #38249

diff --git src/hg/hgTracks/mafTrack.h src/hg/hgTracks/mafTrack.h
index a2f8d2685c8..ff0adf74fc0 100644
--- src/hg/hgTracks/mafTrack.h
+++ src/hg/hgTracks/mafTrack.h
@@ -1,43 +1,47 @@
 /* mafTrack.h - MAF track display */
 
 /* Copyright (C) 2009 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #ifndef MAFTRACK_H
 #define MAFTRACK_H
 
 #ifndef MAF_H
 #include "maf.h"
 #endif
 
+#ifndef QUICKLIFT_H
+#include "quickLift.h"
+#endif
+
 struct mafPriv
 {
 void *list;
 struct customTrack *ct;
 };
 
 struct mafPriv *getMafPriv(struct track *track);
 
 /* zoom level where summary file is used */
 static inline boolean inSummaryMode(struct cart *cart, struct trackDb *tdb, int winSize)
 {
 // A quickLifted maf track has no summary to read.  The summary names a table or file
 // belonging to the assembly the track came from, so it cannot be queried with reference
 // coordinates, and for a hub track the setting comes back rewritten as a path under the
 // hub besides.  Read the real blocks and lift them instead.
-if (trackDbSetting(tdb, "quickLiftDb") != NULL)
+if (quickLiftIsLifted(tdb))
     return FALSE;
 
 char *snpTable = trackDbSetting(tdb, "snpTable");
 unsigned summaryWindowSize = cartOrTdbInt(cart, tdb, "summaryWindowSize", 1000000);
 
 boolean windowBigEnough =  (winSize > summaryWindowSize);
 boolean doSnpMode = (snpTable != NULL) && cartOrTdbBoolean(cart, tdb, MAF_SHOW_SNP,FALSE);
 return windowBigEnough && !doSnpMode;
 }
 
 
 /* zoom level that displays synteny breaks and nesting brackets */
 #define MAF_DETAIL_VIEW 30000
 
 void drawMafRegionDetails(struct mafAli *mafList, int height,