From bd4e3ac77b56f644b6e5afc8c43c8a77848dbb52 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 14 May 2019 20:58:33 +0200 Subject: prog: fix crash in assignSize on optional pointer --- prog/size.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prog/size.go b/prog/size.go index 5586d0da5..23248c722 100644 --- a/prog/size.go +++ b/prog/size.go @@ -47,6 +47,10 @@ func (target *Target) assignSize(dst *ConstArg, pos Arg, path []string, args []A continue } buf = InnerArg(buf) + if buf == nil { + dst.Val = 0 // target is an optional pointer + return + } if len(path) == 0 { dst.Val = target.computeSize(buf, dst.Type().(*LenType)) } else { -- cgit mrf-deployment