File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,8 +249,10 @@ process_one_alternative(const char *altgrname, const char *val)
249249 if (a == NULL )
250250 die ("xbps_array_create" );
251251 }
252- altfiles = strchr (val , ':' ) + 1 ;
253- assert (altfiles );
252+ altfiles = strchr (val , ':' );
253+ if (!altfiles )
254+ diex ("invalid alternative" );
255+ altfiles += 1 ;
254256
255257 xbps_array_add_cstring (a , altfiles );
256258 xbps_dictionary_set (d , altgrname , a );
@@ -278,7 +280,8 @@ process_dict_of_arrays(const char *key UNUSED, const char *val)
278280
279281 if (strchr (args , ' ' ) == NULL ) {
280282 altgrname = strtok (args , ":" );
281- assert (altgrname );
283+ if (!altgrname )
284+ diex ("invalid alternative" );
282285 process_one_alternative (altgrname , val );
283286 goto out ;
284287 }
@@ -288,9 +291,12 @@ process_dict_of_arrays(const char *key UNUSED, const char *val)
288291 char * b ;
289292
290293 b = strdup (p );
291- assert (b );
294+ if (!b )
295+ die ("strdup" );
296+
292297 altgrname = strtok (b , ":" );
293- assert (altgrname );
298+ if (!altgrname )
299+ diex ("invalid alternative" );
294300 process_one_alternative (altgrname , p );
295301 free (b );
296302 }
You can’t perform that action at this time.
0 commit comments