1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-25 10:50:08 +03:00

io: Don't call getcwd in xmlParserGetDirectory

The "directory" value isn't used internally. Calling getcwd is
unnecessary and can cause problems in sandboxed environments.

Fixes #770.
This commit is contained in:
Nick Wellnhofer 2024-07-18 01:54:22 +02:00
parent 152021002d
commit 7b98e8d695

View File

@ -2600,10 +2600,7 @@ xmlParserGetDirectory(const char *filename) {
else *cur = 0;
ret = xmlMemStrdup(dir);
} else {
if (getcwd(dir, 1024) != NULL) {
dir[1023] = 0;
ret = xmlMemStrdup(dir);
}
ret = xmlMemStrdup(".");
}
return(ret);
#undef IS_XMLPGD_SEP