mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch 'mysql/5.5' into 5.5
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2014, Monty Program Ab.
|
||||
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2018, Monty Program Ab.
|
||||
|
||||
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
|
||||
@ -193,6 +193,11 @@ template <class T> T available_buffer(const char* buf_start,
|
||||
const char* buf_current,
|
||||
T buf_len)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (buf_current < buf_start ||
|
||||
buf_len < static_cast<T>(buf_current - buf_start))
|
||||
return static_cast<T>(0);
|
||||
|
||||
return buf_len - (buf_current - buf_start);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user