summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-09-28 17:27:42 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-09-28 17:27:42 +0530
commit6cbbd6bd96a8b5c97ec4d0b687aac29fb0f63a6a (patch)
tree93d54c9fc71e2e76d1695cd5189bb8298c29d2e9 /sql/protocol.cc
parenta6987d9fb921a6638bb1a2397b89ca606fad6f49 (diff)
parent842616532a76cd078ba1d526ae4b85d3ad4be069 (diff)
downloadmariadb-git-6cbbd6bd96a8b5c97ec4d0b687aac29fb0f63a6a.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 02c95a42695..3f4e251403b 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2012, Monty Program Ab
+ Copyright (c) 2008, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,7 +58,8 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
packet->realloc(packet_length+9+length))
return 1;
uchar *to= net_store_length((uchar*) packet->ptr()+packet_length, length);
- memcpy(to,from,length);
+ if (length)
+ memcpy(to,from,length);
packet->length((uint) (to+length-(uchar*) packet->ptr()));
return 0;
}
@@ -716,7 +717,8 @@ void net_send_progress_packet(THD *thd)
uchar *net_store_data(uchar *to, const uchar *from, size_t length)
{
to=net_store_length_fast(to,length);
- memcpy(to,from,length);
+ if (length)
+ memcpy(to,from,length);
return to+length;
}