On Tuesday 19 February 2008 15:19, Cristian Ionescu-Idbohrn wrote:
> On Tue, 19 Feb 2008, Denys Vlasenko wrote:
>
> > Here:
> >
> > /* "A=a B=$A" case: var_str_list is a list of "A=a" strings
> > * which should be considered before we check variables. */
> > if (var_str_list) {
> >
> > Does it work again yf you replace "if (var_str_list)" with "if (0)"?
>
> Yes.
>
> > If yes, can you add lots of bb_error_msg("LINE %d", __LINE__)
> > to the body of the "if" and find out where it dies?
>
> Modified ash r21030 as in attachment, produces this output:
>
> # for B in $VAR;do echo $B;done
> sh: LINE 5907
> sh: LINE 5914: name_len=4
> sh: LINE 5916
> sh (pid 76) segfaults for page address 20188000 at pc 355a06a6
I think str can be NULL. Possible fix:
- char *str = var_str_list->text;
- char *eq = strchr(str, '=');
+ char *eq;
+ char *str = var_str_list->text;
+ if (!str) break;
+ eq = strchr(str, '=');
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox