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 b69bc3fCopy full SHA for b69bc3f
ext/pdo_pgsql/pgsql_driver.c
@@ -38,8 +38,14 @@ 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
char *tmp;
43
+ if (i == 0) {
44
+ tmp = pemalloc(1, persistent);
45
+ ret[0] = '\0';
46
+ return tmp;
47
+ }
48
+ i--;
49
50
if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') {
51
--i;
0 commit comments