summaryrefslogtreecommitdiff
path: root/examples/mlil_parser
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-02-19 17:05:33 -0500
committerGlenn Smith <glenn@vector35.com>2023-02-19 17:21:20 -0500
commit9993345001464331697167349803235498218652 (patch)
tree68c0f3796472880913edd1163f287caf457d3ff6 /examples/mlil_parser
parent18ffd57986569523887621d6b1937046849849a8 (diff)
Account for BinaryData::Ctor potentially failing
Diffstat (limited to 'examples/mlil_parser')
-rw-r--r--examples/mlil_parser/src/mlil_parser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/mlil_parser/src/mlil_parser.cpp b/examples/mlil_parser/src/mlil_parser.cpp
index d858b59c..c5b077ab 100644
--- a/examples/mlil_parser/src/mlil_parser.cpp
+++ b/examples/mlil_parser/src/mlil_parser.cpp
@@ -241,7 +241,12 @@ int main(int argc, char* argv[])
SetBundledPluginDirectory(GetBundledPluginDirectory());
InitPlugins();
- Ref<BinaryData> bd = new BinaryData(new FileMetadata(), argv[1]);
+ Ref<BinaryData> bd = BinaryData::CreateFromFilename(new FileMetadata(), argv[1]);
+ if (!bd)
+ {
+ fprintf(stderr, "Could not open input file.\n");
+ return -1;
+ }
Ref<BinaryView> bv;
for (auto type : BinaryViewType::GetViewTypes())
{