Skip to content

Conversation

LionsAd
Copy link

@LionsAd LionsAd commented Nov 5, 2015

See: https://bugs.php.net/bug.php?id=70861

The original fix for https://bugs.php.net/bug.php?id=70861 unfortunately did fix the crash, but not the issue.

The problem is given a PG SQL PDO stmt $stmt when doing:

         $value = '';

          $blob = fopen('php://memory', 'a');
          fwrite($blob, $value);
          rewind($blob);

          $stmt->bindParam(':db_insert_placeholder_0' , $blob, \PDO::PARAM_LOB);

That then php_stream_copy_to_mem() returns NULL, but if we don't bind the placeholder than the query fails.

The attached patch uses an empty ZSTR to remove the problem, which probably makes sense that an empty resource is mapped to an empty string instead of NULL.

There might be a better fix available, but this fixes the test for me.

@php-pulls
Copy link

Comment on behalf of ab at php.net:

Merged, thanks!

@php-pulls php-pulls closed this Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants