summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_persist.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/com_dotnet/com_persist.c')
-rwxr-xr-xext/com_dotnet/com_persist.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index b59d2ebb4..e53b86c23 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_persist.c,v 1.5.2.3 2006/03/29 14:28:41 tony2001 Exp $ */
+/* $Id: com_persist.c,v 1.5.2.3.2.1 2006/09/16 18:10:32 iliaa Exp $ */
/* Infrastructure for working with persistent COM objects.
* Implements: IStream* wrapper for PHP streams.
@@ -390,15 +390,16 @@ CPH_METHOD(SaveToFile)
if (filename) {
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!fullpath) {
RETURN_FALSE;
}
-
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
RETURN_FALSE;
}
-
+
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
efree(fullpath);
}
@@ -452,13 +453,13 @@ CPH_METHOD(LoadFromFile)
return;
}
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
RETURN_FALSE;
}