ccef6d8214667ea8c41fee935d099026a6ad8bb6
angie
  Wed Feb 1 15:04:01 2012 -0800
MLQ #6823:In hGetChromInfo, if chrom name is implausibly long, just return NULL
(i.e. not a valid chrom name) so we don't pointlessly safef -> errAbort.

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 1f51887..fb55bf9 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -86,30 +86,32 @@
 return ci;
 }
 
 struct chromInfo *hGetChromInfo(char *db, char *chrom)
 /* Get chromInfo for named chromosome (case-insens.) from db.
  * Return NULL if no such chrom. */
 /* Cache results, but build up the hash incrementally instead of in one slurp
  * from chromInfo because that takes a *long* time for scaffold-based dbs and
  * is usually not necessary. */
 {
 static struct hash *dbToInfo = NULL;
 struct hash *infoHash = NULL;
 struct hashEl *dHel = NULL;
 struct chromInfo *ci = NULL;
 char upcName[HDB_MAX_CHROM_STRING];
+if (strlen(chrom) >= HDB_MAX_CHROM_STRING)
+    return NULL;
 safef(upcName, sizeof(upcName), "%s", chrom);
 touppers(upcName);
 
 if (dbToInfo == NULL)
     dbToInfo = hashNew(0);
 dHel = hashLookup(dbToInfo, db);
 if (dHel == NULL)
     {
     infoHash = hashNew(0);
     hashAdd(dbToInfo, db, infoHash);
     }
 else
     infoHash = (struct hash *)(dHel->val);
 ci = (struct chromInfo *)hashFindVal(infoHash, upcName);
 if (ci == NULL)