Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 8699ba2

Browse files
committed
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.
1 parent bf43e8a commit 8699ba2

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

xmlIO.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,10 +2904,7 @@ xmlParserGetDirectory(const char *filename) {
29042904
else *cur = 0;
29052905
ret = xmlMemStrdup(dir);
29062906
} else {
2907-
if (getcwd(dir, 1024) != NULL) {
2908-
dir[1023] = 0;
2909-
ret = xmlMemStrdup(dir);
2910-
}
2907+
ret = xmlMemStrdup(".");
29112908
}
29122909
return(ret);
29132910
#undef IS_XMLPGD_SEP

0 commit comments

Comments
 (0)