32c14e84f7d538b9590dfa9bfa79332f8ba057d2
angie
  Wed Jan 15 15:13:04 2014 -0800
A recent change introduced a case in which fullName could be useduninitialized.  Give it the sensible default value first, and
override if there's an unusual case.  refs #12352

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 2fef5b3..684d772 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -3055,45 +3055,45 @@
 
 db = sqlGetDatabase(conn);
 
 if (chrom == NULL)
     chrom = hDefaultChrom(db);
 if (dbHash == NULL)
     dbHash = newHash(8);
 hash = hashFindVal(dbHash, db);
 if (hash == NULL)
     {
     hash = newHash(8);
     hashAdd(dbHash, db, hash);
     }
 if ((hti = hashFindVal(hash, rootName)) == NULL)
     {
+    safecpy(fullName, sizeof(fullName), rootName);
     if ((sameString(rootName, "mrna") && sqlTableExists(conn, "all_mrna")) ||
 	(sameString(rootName, "est") && sqlTableExists(conn, "all_est")))
 	{
 	safef(fullName, sizeof(fullName), "all_%s", rootName);
 	rootName = fullName;
 	}
     else
 	{
 	if (chrom != NULL)
 	    {
             // first try the non-split table name then the split table name. 
             // In 2013, very few assemblies have split tables
             // This avoids dozens of mostly useless chrX_table lookups
             isSplit = TRUE;
-            safef(fullName, sizeof(fullName), "%s", rootName);
 	    if (sqlTableExists(conn, fullName))
 		isSplit = FALSE;
             else 
                 {
                 safef(fullName, sizeof(fullName), "%s_%s", chrom, rootName);
                 if (sqlTableExists(conn, fullName))
                     isSplit = TRUE; 
                 else
                     return NULL;
                 }
 	    }
 	}
     AllocVar(hti);
     hashAddSaveName(hash, rootName, hti, &hti->rootName);
     hti->isSplit = isSplit;