ecd6e5bc9b85bcbafb08da0c1dae876b284ba69c
angie
  Fri May 20 16:17:00 2016 -0700
New random-token method for login (HT Max & Galt): instead of requiring a new table gbMemberToken, use autoUpgrade to add a new column (keyList) to gbMembers that contains a list of long random keys, analogous to userDb and sessionDb's sessionKey (see cartDb.c).  The token cookie now includes both gbMembers.idx (for fast lookup) and the long random key, similar to the hguid cookie and hgsid CGI param.  keyList is a list in order to support user login on multiple web clients.  refs #17327 #17336 note-11

diff --git src/lib/common.c src/lib/common.c
index 4191577..e6042e2 100644
--- src/lib/common.c
+++ src/lib/common.c
@@ -852,30 +852,33 @@
     slAddHead(&list, el);
     }
 slReverse(&list);
 return list;
 }
 
 char *slNameListToString(struct slName *list, char delimiter)
 /* Return string created by joining all names with the delimiter. */
 {
 struct slName *el;
 int elCount = 0;
 int len = 0;
 char del[2];
 char *s;
 
+if (list == NULL)
+    return cloneString("");
+
 del[0] = delimiter;
 del[1] = '\0';
 
 for (el = list; el != NULL; el = el->next, elCount++)
 	len += strlen(el->name);
 len += elCount;
 
 AllocArray(s, len);
 
 for (el = list; el != NULL; el = el->next)
 	{
 	strcat(s, el->name);
 	if (el->next != NULL)
 		strcat(s, del);
 	}