388a9e0a5bfd5a783708c1ad4b152a857d011437 angie Tue Apr 26 21:01:10 2011 -0700 Bug #3765 (buffer overflow error in Common SNP (132)): plugged up hole in snp125ValidFilter logic that allowed use of NULL var. diff --git src/hg/hgTracks/variation.c src/hg/hgTracks/variation.c index b9562ab..51518b3 100644 --- src/hg/hgTracks/variation.c +++ src/hg/hgTracks/variation.c @@ -235,32 +235,32 @@ } static boolean snp125ValidFilterItem(void *item) /* Return TRUE if item passes filter, i.e. has an included property. */ { struct snp125 *el = (struct snp125 *)item; if (! snp125ValidFilterOn) return TRUE; else { char *s = el->valid, *e; char val[256]; // Longest validation code is much shorter than this while (s != NULL && s[0] != 0) { e = strchr(s, ','); - if (e == NULL && slNameInList(snp125ValidFilter, s)) - return TRUE; + if (e == NULL) + return slNameInList(snp125ValidFilter, s); else { safencpy(val, sizeof(val), s, e-s); if (slNameInList(snp125ValidFilter, val)) return TRUE; e += 1; } s = e; } return FALSE; } } boolean snpFuncFilterItem(struct track *tg, void *item) /* Return TRUE if item passes filter, i.e. has no excluded property. */