[Crash-utility] [PATCH v2] Fixed the segment fault when ikconfig passed nonstandard values

d.hatayama at fujitsu.com d.hatayama at fujitsu.com
Wed Jan 6 04:14:58 UTC 2021


>  static int setup_ikconfig(char *config)
> @@ -10265,8 +10273,8 @@ static int setup_ikconfig(char *config)
>                         ent++;
> 
>                 if (STRNEQ(ent, "CONFIG_")) {

Another natural fix to me is to extend the condition like:

    if (STRNEQ(ent, "CONFIG_") && strstr(ent, "=")) {

But I also think the current one is good.

> -                       add_ikconfig_entry(ent,
> -                                        &ikconfig_all[kt->ikconfig_ents++]);
> +                       if (add_ikconfig_entry(ent, &ikconfig_all[kt->ikconfig_ents]))
> +                               kt->ikconfig_ents++;
>                         if (kt->ikconfig_ents == IKCONFIG_MAX) {
>                                 error(WARNING, "ikconfig overflow.\n");
>                                 return 1;
> --
> 2.17.1
> 
> 
> 

Thanks.
HATAYAMA, Daisuke






More information about the Crash-utility mailing list