Skip to content

Commit 104f5ef

Browse files
committed
Safety on signal parse
See fyne-io/fyne#4385
1 parent 18ba13a commit 104f5ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

systray_unix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ func stayRegistered() {
267267
case sig := <-sc:
268268
if sig == nil {
269269
return // We get a nil signal when closing the window.
270+
} else if len(sig.Body) < 3 {
271+
return // malformed signal?
270272
}
271273

272274
// sig.Body has the args, which are [name old_owner new_owner]
273-
if sig.Body[2] != "" {
275+
if s, ok := sig.Body[2].(string); ok && s != "" {
274276
register()
275277
}
276278
case <-quitChan:

0 commit comments

Comments
 (0)