Skip to content

Commit 6e5fe9c

Browse files
author
Anushree Prakash B
committed
Bug#29921423 - MEMCPY-PARAM-OVERLAP IN CLI_READ_ROWS
DESCRIPTION =========== There is a memcpy-param-overlap (likely leading to a multi byte write heap buffer overflow) in function cli_read_rows called by mysql_store_result. FIX === Added appropriate boundary checks while reading the packets, and if an invalid packet data is detected, an error is returned. RB: 24485
1 parent 0202865 commit 6e5fe9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql-common/client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -1630,7 +1630,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
16301630
else
16311631
{
16321632
cur->data[field] = to;
1633-
if (len > (ulong) (end_to - to))
1633+
if (to > end_to || len > (ulong) (end_to - to))
16341634
{
16351635
free_rows(result);
16361636
set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);

0 commit comments

Comments
 (0)