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 f94c11f commit 7c1ee48Copy full SHA for 7c1ee48
ext/pdo_pgsql/pgsql_driver.c
@@ -38,7 +38,13 @@ static bool pgsql_handle_in_transaction(pdo_dbh_t *dbh);
38
39
static char * _pdo_pgsql_trim_message(const char *message, int persistent)
40
{
41
- size_t i = strlen(message)-1;
+ size_t i = strlen(message);
42
+ if (i == 0) {
43
+ char *ret = pemalloc(1, persistent);
44
+ ret[0] = '\0';
45
+ return ret;
46
+ }
47
+ i--;
48
char *tmp;
49
50
if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') {
0 commit comments