diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-13 16:34:27 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-13 17:58:30 +0200 |
commit | 26020c84ab10cd5c10b9a603b365d6107f1a5b21 (patch) | |
tree | 7c1af1b0df4468fccd3a314383d80385eaa2b5e8 /comphelper | |
parent | d8b123b4b00bbc5094ff79491d2675b476087632 (diff) |
updater: fix crash on windows while creating the updater command line
Change-Id: I606f5ede0fe70af4b30c68a10b7c400612fddaee
Reviewed-on: https://gerrit.libreoffice.org/41115
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/windows/windows_process.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/comphelper/source/windows/windows_process.cxx b/comphelper/source/windows/windows_process.cxx index 1c782d7a289f..b7fa19373dc2 100644 --- a/comphelper/source/windows/windows_process.cxx +++ b/comphelper/source/windows/windows_process.cxx @@ -135,7 +135,7 @@ MakeCommandLine(int argc, wchar_t **argv) int len = 0; // The + 1 of the last argument handles the allocation for null termination - for (i = 0; i < argc; ++i) + for (i = 0; i < argc && argv[i]; ++i) len += ArgStrLen(argv[i]) + 1; // Protect against callers that pass 0 arguments @@ -147,7 +147,7 @@ MakeCommandLine(int argc, wchar_t **argv) return nullptr; wchar_t *c = s; - for (i = 0; i < argc; ++i) + for (i = 0; i < argc && argv[i]; ++i) { c = ArgToString(c, argv[i]); if (i + 1 != argc) |