mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +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:
parent
793ce67c72
commit
530bf9060b
@ -846,7 +846,7 @@ SCHAR *INF_put_item(SCHAR item,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
if (ptr + length + 4 >= end) {
|
||||
if (ptr + length + 4 > end) {
|
||||
*ptr = gds_info_truncated;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1358,7 +1358,10 @@ void SVC_putc(SVC service, UCHAR ch)
|
||||
to store a read to eof, return the data that was read along
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user