From bd4fddce693dc168fd5a8e7403226f8476e7b6d2 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 17 Sep 2023 10:39:38 +0800 Subject: [PATCH] :bug: Kernel crash when copy-pasting from some browsers https://github.com/siyuan-note/siyuan/issues/9203 --- kernel/api/lute.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/api/lute.go b/kernel/api/lute.go index 6c8f611ea..f8e774407 100644 --- a/kernel/api/lute.go +++ b/kernel/api/lute.go @@ -104,6 +104,11 @@ func html2BlockDOM(c *gin.Context) { if gulu.OS.IsWindows() { localPath = strings.TrimPrefix(localPath, "/") } + + if !filepath.IsAbs(localPath) { + // Kernel crash when copy-pasting from some browsers https://github.com/siyuan-note/siyuan/issues/9203 + return ast.WalkContinue + } if !gulu.File.IsExist(localPath) { return ast.WalkContinue }