From 0e831cf1576216cb75e2458677a7f107ac5266e3 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 30 Sep 2026 16:14:53 +0800 Subject: [PATCH] fix: clear *pprocess when file copy fails in DocumentFactory::getDocument Every other error branch of getDocument() sets *pprocess = nullptr before returning, but the QFile::copy() failure path left the output parameter untouched, so callers relying on *process == nullptr could read a stale pointer. Align the branch with the rest. Log: Influence: document opening --- reader/document/Model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index 03b981f72..09dbd8718 100644 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -160,6 +160,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & if (!file.copy(targetDoc)) { qCritical() << "Failed to copy file from" << filePath << "to" << targetDoc; error = deepin_reader::Document::ConvertFailed; + *pprocess = nullptr; return nullptr; }