win32_chdir() et al don't handle a NULL argument gracefully
p4raw-link: @12146 on //depot/maint-5.6/perl:
4e267243e0f1e4a79c99c8aa048aeec9c0d5cd6f
p4raw-id: //depot/perl@12147
p4raw-integrated: from //depot/maint-5.6/perl@12144 'merge in'
win32/perlhost.h (@11401..) win32/win32.c (@12026..)
{
dTHX;
int ret;
+ if (!dirname) {
+ errno = ENOENT;
+ return -1;
+ }
if (USING_WIDE()) {
WCHAR wBuffer[MAX_PATH];
A2WHELPER(dirname, wBuffer, sizeof(wBuffer));
DllExport int
win32_chdir(const char *dir)
{
- dTHX;
+ dTHXo;
+ if (!dir) {
+ errno = ENOENT;
+ return -1;
+ }
if (USING_WIDE()) {
WCHAR wBuffer[MAX_PATH+1];
A2WHELPER(dir, wBuffer, sizeof(wBuffer));