We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c1e461 commit e0f2741Copy full SHA for e0f2741
ext/pdo_pgsql/pgsql_driver.c
@@ -39,7 +39,13 @@ static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh);
39
40
static char * _pdo_pgsql_trim_message(const char *message, int persistent)
41
{
42
- size_t i = strlen(message)-1;
+ size_t i = strlen(message);
43
+ if (i == 0) {
44
+ char *ret = pemalloc(1, persistent);
45
+ ret[0] = '\0';
46
+ return ret;
47
+ }
48
+ i--;
49
char *tmp;
50
51
if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') {
0 commit comments