File gcc9-warning.patch of Package xtrabackup

From b47d098fd6705eb15302dbe136f142a617d30998 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 25 Feb 2019 15:19:04 +0100
Subject: [PATCH] Fix new GCC 9 warning:

[  874s] In function 'void* memcpy(void*, const void*, size_t)',
[  874s]     inlined from 'virtual String* Item_func_format::val_str_ascii(String*)' at /home/abuild/rpmbuild/BUILD/percona-xtrabackup-2.4.12/sql/item_strfunc.cc:3214:13:
[  874s] /usr/include/bits/string_fortified.h:34:33: warning: 'void* __builtin_memcpy(void*, const void*, unsigned int)' writing 1 or more bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
[  874s]    34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));

It's analyzed here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89350
---
 sql/item_strfunc.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: percona-xtrabackup-2.4.26/sql/item_strfunc.cc
===================================================================
--- percona-xtrabackup-2.4.26.orig/sql/item_strfunc.cc
+++ percona-xtrabackup-2.4.26/sql/item_strfunc.cc
@@ -2995,7 +2995,7 @@ String *Item_func_format::val_str_ascii(
     char *start_dst = dst;
 
     /* Put the fractional part */
-    if (dec)
+    if (dec > 0)
     {
       dst-= (dec + 1);
       *dst= lc->decimal_point;
openSUSE Build Service is sponsored by