@@ -284,7 +284,7 @@ PHP_FUNCTION(oci_lob_import)
284
284
char * filename ;
285
285
size_t filename_len ;
286
286
287
- if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Op " , & z_descriptor , oci_lob_class_entry_ptr , & filename , & filename_len ) == FAILURE ) {
287
+ if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Os " , & z_descriptor , oci_lob_class_entry_ptr , & filename , & filename_len ) == FAILURE ) {
288
288
RETURN_THROWS ();
289
289
}
290
290
@@ -293,6 +293,11 @@ PHP_FUNCTION(oci_lob_import)
293
293
RETURN_FALSE ;
294
294
}
295
295
296
+ if (CHECK_NULL_PATH (filename , filename_len )) {
297
+ php_error_docref (NULL , E_WARNING , "filename must not contain null bytes" );
298
+ RETURN_FALSE ;
299
+ }
300
+
296
301
PHP_OCI_ZVAL_TO_DESCRIPTOR (tmp , descriptor );
297
302
298
303
if (php_oci_lob_import (descriptor , filename )) {
@@ -835,7 +840,7 @@ PHP_FUNCTION(oci_lob_export)
835
840
php_stream * stream ;
836
841
ub4 lob_length ;
837
842
838
- if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Op |ll" , & z_descriptor , oci_lob_class_entry_ptr , & filename , & filename_len , & start , & length ) == FAILURE ) {
843
+ if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Os |ll" , & z_descriptor , oci_lob_class_entry_ptr , & filename , & filename_len , & start , & length ) == FAILURE ) {
839
844
RETURN_THROWS ();
840
845
}
841
846
@@ -864,6 +869,11 @@ PHP_FUNCTION(oci_lob_export)
864
869
RETURN_FALSE ;
865
870
}
866
871
872
+ if (CHECK_NULL_PATH (filename , filename_len )) {
873
+ php_error_docref (NULL , E_WARNING , "filename must not contain null bytes" );
874
+ RETURN_FALSE ;
875
+ }
876
+
867
877
PHP_OCI_ZVAL_TO_DESCRIPTOR (tmp , descriptor );
868
878
869
879
if (php_oci_lob_get_length (descriptor , & lob_length )) {
0 commit comments