diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-15 20:15:20 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-15 19:52:10 +0000 |
commit | b5876bfcb69a65c87d602bae687b3c0634c0a1e7 (patch) | |
tree | fd8aa09998bcb885cef6d99e9c5721de5c43b929 | |
parent | 4d18c1de112c1439ae4e41de7c19ffa449afea68 (diff) |
passing a NULL pointer to fileno is not allowed
See crash reports at
http://crashreport.libreoffice.org/stats/signature/do_msvcr_magic+0x7
and documentation at
https://msdn.microsoft.com/en-us/library/zs6wbdhx.aspx
Change-Id: Ia9166d3b9fa10b87585821504e39cdfecbd22eda
Reviewed-on: https://gerrit.libreoffice.org/26317
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index fad3c0a9309e..43ddc827fefa 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -548,6 +548,9 @@ static void do_msvcr_magic(rtl_uString *jvm_dll) FILE *f = _wfopen(reinterpret_cast<LPCWSTR>(Module->buffer), L"rb"); + if (!f) + return; + if (fstat(fileno(f), &st) == -1) { fclose(f); |