diff options
author | Anushree Prakash B <anushree.prakash.b@oracle.com> | 2019-02-28 09:29:45 +0530 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-07-24 18:32:24 +0200 |
commit | 9c6777c03c6bdeb329865fe56a9662d15058ff9f (patch) | |
tree | 011378551426314438d130f82592d5757073b5e7 /plugin | |
parent | 9d93f9dac4d144e8b08d2ba175c10b068daf9235 (diff) | |
download | mariadb-git-9c6777c03c6bdeb329865fe56a9662d15058ff9f.tar.gz |
Bug#27259654 - ISSUES FOUND BY PVS-STUDIO STATIC ANALYZER
DESCRIPTION
===========
PVS-Studio static code analyzer found several suspicious
fragments of code across various files.
i) sizeof() is using the pointer
ii) memcpy() doesn't copy the whole string.
iii) enumeration constant 'wkb_multilinestring' is used as
a variable of a Boolean-type.
iv) 'throw' keyword is missing from std::runtime_error()
FIX
===
i) Use sizeof({actual object/data type})
ii) Use strncpy() and set last char as '\0'
iii) N/A (Issue has already been fixed)
iv) Add 'throw' before the exception.
RB: 21502
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/win_auth_client/common.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/win_auth_client/common.cc b/plugin/win_auth_client/common.cc index 0cfbb2e802c..27f1685e200 100644 --- a/plugin/win_auth_client/common.cc +++ b/plugin/win_auth_client/common.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. 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 @@ -504,7 +504,7 @@ const char* get_last_error_message(Error_message_buf buf) buf[0]= '\0'; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)buf, sizeof(buf), NULL ); + (LPTSTR)buf, sizeof(Error_message_buf), NULL); return buf; } |