Skip to content

Commit 1ff1206

Browse files
authored
Merge pull request #9228 from mikesinouye/write_db
utl: Fix crash for write_db ""
2 parents b2e0655 + 12d1e00 commit 1ff1206

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utl/src/ScopedTemporaryFile.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ ScopedTemporaryFile::~ScopedTemporaryFile()
6767
OutStreamHandler::OutStreamHandler(const char* filename, bool binary)
6868
: filename_(filename)
6969
{
70+
if (filename_.empty()) {
71+
throw std::runtime_error("filename is empty");
72+
}
7073
tmp_filename_ = generate_unused_filename(filename_);
7174

7275
os_.exceptions(std::ofstream::failbit | std::ofstream::badbit);

0 commit comments

Comments
 (0)