8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 06:03:02 +01:00

bugfix on service API, reported by Martijn Tonies in fb-devel.

This bug exists already since FB1.0.
Due bad validate-checking on returned value this even causes a server-crash !!!!
This commit is contained in:
arnobrinkman 2003-03-20 22:43:40 +00:00
parent 793ce67c72
commit 530bf9060b
2 changed files with 5 additions and 2 deletions

View File

@ -846,7 +846,7 @@ SCHAR *INF_put_item(SCHAR item,
* *
**************************************/ **************************************/
if (ptr + length + 4 >= end) { if (ptr + length + 4 > end) {
*ptr = gds_info_truncated; *ptr = gds_info_truncated;
return NULL; return NULL;
} }

View File

@ -1358,7 +1358,10 @@ void SVC_putc(SVC service, UCHAR ch)
to store a read to eof, return the data that was read along to store a read to eof, return the data that was read along
with an indication that more is available. */ with an indication that more is available. */
info = INF_put_item(item, length, info + 3, info, end); if (!(info = INF_put_item(item, length, info + 3, info, end))) {
THREAD_ENTER;
return 0;
}
if (service->svc_flags & SVC_timeout) if (service->svc_flags & SVC_timeout)
{ {