Handle application paths larger than MAX_PATH, and fix potential buffer overflow
commitcfadf08a6c06ce319f6144e724f45e4923e72778
authorMarius Storm-Olsen <marius@trolltech.com>
Wed, 1 Jul 2009 09:49:51 +0000 (1 11:49 +0200)
committerMarius Storm-Olsen <marius@trolltech.com>
Wed, 1 Jul 2009 09:51:13 +0000 (1 11:51 +0200)
tree672f5e0515b2b0cf718aca773eb87f9f4f738f0e
parent5ae330b6546dabada53c394b53ce9513f552a8a5
Handle application paths larger than MAX_PATH, and fix potential buffer overflow

These days we can easily get very long paths, so we should support
application paths as long as needed.

There was also a potention exploit in that if the path was MAX_PATH or
larger, the string would not be \0 terminated (see MSDN docs for
GetModuleFileName), and thus cause problems in QString::fromWCharArray().

Merge-request: 604
Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
src/corelib/kernel/qcoreapplication.cpp
src/corelib/kernel/qcoreapplication_win.cpp