[augeas-devel] [PATCH] Fix segfault in get.c with L_MAYBE lens (bug#180)

David Lutterkort lutter at redhat.com
Wed Feb 16 01:58:04 UTC 2011


On Thu, 2011-02-10 at 00:03 -0500, Francis Giraldeau wrote:
> When a L_MAYBE lens was the last child of a L_CONCAT inside a L_SUBTREE, then
> the match in visit_exit top_frame(rec_state)->lens == lens->child was true,
> causing combine of a frame when it shouldn't. This test is true because there
> is no other lens following in the concat in this special case, hence the top
> frame matched the child of the L_MAYBE.
> 
> To avoid this special case, we propose to push L_MAYBE lens on the frames
> stack. If L_MAYBE is encountered in visit_exit, we pop at least one frame and
> two if the child match. This way, the stack is always valid.
> 
> Closes trac ticket #180.

ACK. Nice fix.

David





More information about the augeas-devel mailing list