Skip to content

Commit 1b690e5

Browse files
committed
vfs: don't crash if copy_file can't open output file (LP 1687283)
1 parent 8b3ad73 commit 1b690e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

panda/src/express/virtualFileSimple.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,16 @@ copy_file(VirtualFile *new_file) {
150150
// Different mount point, or the mount doesn't support copying. Do it by
151151
// hand.
152152
ostream *out = new_file->open_write_file(false, true);
153+
if (out == nullptr) {
154+
return false;
155+
}
156+
153157
istream *in = open_read_file(false);
158+
if (in == nullptr) {
159+
new_file->close_write_file(out);
160+
new_file->delete_file();
161+
return false;
162+
}
154163

155164
static const size_t buffer_size = 4096;
156165
char buffer[buffer_size];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy