Author: mlandres Date: Tue Feb 5 21:33:39 2008 New Revision: 8482 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8482&view=rev Log: fix segv when str2id(pool,NULL) Modified: trunk/sat-solver/src/strpool.c Modified: trunk/sat-solver/src/strpool.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/strpool.c?rev=8482&r1=8481&r2=8482&view=diff ============================================================================== --- trunk/sat-solver/src/strpool.c (original) +++ trunk/sat-solver/src/strpool.c Tue Feb 5 21:33:39 2008 @@ -42,7 +42,7 @@ stringpool_init_empty(Stringpool *ss) { const char *emptystrs[] = { - "<NULL>", + "<NULL>", "", 0, }; @@ -81,8 +81,8 @@ hashtbl = ss->stringhashtbl; // expand hashtable if needed - // - // + // + // if (ss->nstrings * 2 > hashmask) { sat_free(hashtbl); @@ -142,6 +142,10 @@ Id stringpool_str2id (Stringpool *ss, const char *str, int create) { + if ( !str ) + return STRID_NULL; + if ( !*str ) + return STRID_EMPTY; unsigned len = strlen (str); return stringpool_strn2id (ss, str, len, create); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org