From 45f8a2d2811e3153a201b43d2eb42a0a47c2ba73 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 26 Oct 2022 11:08:35 +0200 Subject: [PATCH] dont panic in app-provider Signed-off-by: jkoberg --- changelog/unreleased/fix-appprovider-panic.md | 4 ++++ pkg/app/provider/wopi/wopi.go | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/fix-appprovider-panic.md diff --git a/changelog/unreleased/fix-appprovider-panic.md b/changelog/unreleased/fix-appprovider-panic.md new file mode 100644 index 0000000000..c54408b65a --- /dev/null +++ b/changelog/unreleased/fix-appprovider-panic.md @@ -0,0 +1,4 @@ +Bugfix: Avoid AppProvider panic + +avoid panic in app provider +https://github.com/cs3org/reva/pull/3394 diff --git a/pkg/app/provider/wopi/wopi.go b/pkg/app/provider/wopi/wopi.go index 583fec374a..cb8e7d11a7 100644 --- a/pkg/app/provider/wopi/wopi.go +++ b/pkg/app/provider/wopi/wopi.go @@ -399,6 +399,9 @@ func parseWopiDiscovery(body io.Reader) (map[string]map[string]string, error) { return nil, err } root := doc.SelectElement("wopi-discovery") + if root == nil { + return nil, errors.New("wopi-discovery response malformed") + } for _, netzone := range root.SelectElements("net-zone") {