quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject incubator-quickstep git commit: Check File Handle in TextScanWorkOrder to avoid segfault.
Date Wed, 07 Mar 2018 14:39:16 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master c2ed5c69b -> 934f3ab87


Check File Handle in TextScanWorkOrder to avoid segfault.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/934f3ab8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/934f3ab8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/934f3ab8

Branch: refs/heads/master
Commit: 934f3ab87b642fa6230a951f051cd44828b96f57
Parents: c2ed5c6
Author: Zuyu Zhang <zuyu@cs.wisc.edu>
Authored: Tue Mar 6 03:00:10 2018 -0600
Committer: Zuyu Zhang <zuyu@cs.wisc.edu>
Committed: Tue Mar 6 03:00:10 2018 -0600

----------------------------------------------------------------------
 relational_operators/TextScanOperator.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/934f3ab8/relational_operators/TextScanOperator.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/TextScanOperator.cpp b/relational_operators/TextScanOperator.cpp
index 66137d8..9e3bcb1 100644
--- a/relational_operators/TextScanOperator.cpp
+++ b/relational_operators/TextScanOperator.cpp
@@ -273,6 +273,11 @@ void TextScanWorkOrder::execute() {
 
     // Read text segment into buffer.
     file = std::fopen(filename_.c_str(), "rb");
+    if (file == nullptr) {
+      LOG(ERROR) << "Failed to open file " << filename_
+                 << " with error: " << strerror(errno);
+      return;
+    }
     std::fseek(file, text_offset_, SEEK_SET);
     bytes_read = std::fread(buffer, 1, text_segment_size_, file);
 


Mime
View raw message