Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <davidebeatrici@gmail.com>2019-10-12 09:26:05 +0300
committerDavide Beatrici <davidebeatrici@gmail.com>2019-10-12 10:01:28 +0300
commit243ece36594efa55cb45df38084cd7a0cdbf93c1 (patch)
treedbdbeb216a517fbc75887ce2add16697e54c06ae /plugins
parent7779447ee4df80c80219d19e8e63c080e9319fb7 (diff)
plugins/bf1: fix sizeof() bug
Found thanks to GCC's warning: ../mumble_plugin_utils.h: In function ‘int fetch(float*, float*, float*, float*, float*, float*, std::string&, std::wstring&)’: ../mumble_plugin_utils.h:35:16: warning: array subscript 99 is outside array bounds of ‘char [4]’ [-Warray-bounds] 35 | str[size - 1] = 0; | ~~~~~~~~~~~~~~^~~ bf1.cpp:15:25: note: while referencing ‘team’ 15 | char server_name[100], team[4]; | ^~~~
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bf1/bf1.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/bf1/bf1.cpp b/plugins/bf1/bf1.cpp
index c2042f2d3..47644a293 100644
--- a/plugins/bf1/bf1.cpp
+++ b/plugins/bf1/bf1.cpp
@@ -107,7 +107,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
oidentity << "{";
// Team
- escape(team, sizeof(server_name));
+ escape(team, sizeof(team));
if (strcmp(team, "") != 0) {
oidentity << std::endl << "\"Team\": \"" << team << "\","; // Set team name in identity.
}