5c060e59f4dfaaef7d80080266ed0784c7b1aa82 galt Mon Feb 13 15:55:34 2017 -0800 using makeRandomKey in cart.c, removed redundant copy in cartDb.c. code review feedback. refs #18737 diff --git src/hg/lib/cart.c src/hg/lib/cart.c index 911a094..d968bdc 100644 --- src/hg/lib/cart.c +++ src/hg/lib/cart.c @@ -240,31 +240,31 @@ { struct cartDb *cdb; boolean result = TRUE; cdb = cartDbLoadFromId(conn, table, secureId); if (!cdb) { result = FALSE; struct dyString *query = dyStringNew(256); sqlDyStringPrintf(query, "INSERT %s VALUES(0,'',0,now(),now(),0", table); char *sessionKey = ""; if (cartDbHasSessionKey(conn, table)) { if (cartDbUseSessionKey()) { - sessionKey = cartDbMakeRandomKey(128+33); // at least 128 bits of protection, 33 for the world population size. + sessionKey = makeRandomKey(128+33); // at least 128 bits of protection, 33 for the world population size. } sqlDyStringPrintf(query, ",'%s'", sessionKey); } sqlDyStringPrintf(query, ")"); sqlUpdate(conn, query->string); dyStringFree(&query); unsigned int id = sqlLastAutoId(conn); char newSecureId[256]; if (cartDbUseSessionKey() && !sameString(sessionKey,"")) safef(newSecureId, sizeof newSecureId, "%u_%s", id, sessionKey); else safef(newSecureId, sizeof newSecureId, "%u", id); if ((cdb = cartDbLoadFromId(conn,table,newSecureId)) == NULL) errAbort("Couldn't get cartDb for id=%u right after loading. " "MySQL problem??", id);