@@ -913,8 +913,9 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
913
913
char swallow ;
914
914
int id ;
915
915
SocketClass * sock = self -> sock ;
916
- static char msgbuffer [MAX_MESSAGE_LEN + 1 ];
917
- char cmdbuffer [MAX_MESSAGE_LEN + 1 ]; /* QR_set_command() dups
916
+ /* ERROR_MSG_LENGTH is suffcient */
917
+ static char msgbuffer [ERROR_MSG_LENGTH + 1 ];
918
+ char cmdbuffer [ERROR_MSG_LENGTH + 1 ]; /* QR_set_command() dups
918
919
* this string so dont
919
920
* need static */
920
921
@@ -986,13 +987,13 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
986
987
{
987
988
case 'A' : /* Asynchronous Messages are ignored */
988
989
(void ) SOCK_get_int (sock , 4 ); /* id of notification */
989
- SOCK_get_string (sock , msgbuffer , MAX_MESSAGE_LEN );
990
+ SOCK_get_string (sock , msgbuffer , ERROR_MSG_LENGTH );
990
991
/* name of the relation the message comes from */
991
992
break ;
992
993
case 'C' : /* portal query command, no tuples
993
994
* returned */
994
995
/* read in the return message from the backend */
995
- SOCK_get_string (sock , cmdbuffer , MAX_MESSAGE_LEN );
996
+ SOCK_get_string (sock , cmdbuffer , ERROR_MSG_LENGTH );
996
997
if (SOCK_get_errcode (sock ) != 0 )
997
998
{
998
999
self -> errornumber = CONNECTION_NO_RESPONSE ;
@@ -1146,7 +1147,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
1146
1147
return res ; /* instead of NULL. Zoltan */
1147
1148
1148
1149
case 'P' : /* get the Portal name */
1149
- SOCK_get_string (sock , msgbuffer , MAX_MESSAGE_LEN );
1150
+ SOCK_get_string (sock , msgbuffer , ERROR_MSG_LENGTH );
1150
1151
break ;
1151
1152
case 'T' : /* Tuple results start here */
1152
1153
result_in = qi ? qi -> result_in : NULL ;
@@ -1209,7 +1210,8 @@ CC_send_function(ConnectionClass *self, int fnid, void *result_buf, int *actual_
1209
1210
c ,
1210
1211
done ;
1211
1212
SocketClass * sock = self -> sock ;
1212
- static char msgbuffer [MAX_MESSAGE_LEN + 1 ];
1213
+ /* ERROR_MSG_LENGTH is sufficient */
1214
+ static char msgbuffer [ERROR_MSG_LENGTH + 1 ];
1213
1215
int i ;
1214
1216
1215
1217
mylog ("send_function(): conn=%u, fnid=%d, result_is_int=%d, nargs=%d\n" , self , fnid , result_is_int , nargs );
0 commit comments