[gazebo] 04/06: strlen
Jochen Sprickerhof
jspricke at moszumanska.debian.org
Sat Dec 23 17:05:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
jspricke pushed a commit to branch patch-queue/master
in repository gazebo.
commit c3d19a2d1b74938400b527ea1ef247af4545da84
Author: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
Date: Sat Dec 23 17:59:19 2017 +0100
strlen
# HG changeset patch
# User Kartik Mohta <kartikmohta at gmail.com>
# Date 1496126419 14400
# Branch fix/GuiIface-strlen
# Node ID 2fac294590a187c851e95b4e3e7e34cdc5c76c6a
# Parent bae84f76b4ad7a6a7cecaeb3e76e545b8c8d5f3e
GuiIface.cc: Fix buffer size for snprintf when putting "gazebo" into g_argv
Gbp-Pq: Name strlen.patch
---
gazebo/gui/GuiIface.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gazebo/gui/GuiIface.cc b/gazebo/gui/GuiIface.cc
index cf32b38..8e85043 100644
--- a/gazebo/gui/GuiIface.cc
+++ b/gazebo/gui/GuiIface.cc
@@ -286,8 +286,8 @@ bool gui::load()
g_argv = new char*[g_argc];
for (int i = 0; i < g_argc; i++)
{
- g_argv[i] = new char[strlen("gazebo")];
- snprintf(g_argv[i], strlen("gazebo"), "gazebo");
+ g_argv[i] = new char[strlen("gazebo") + 1];
+ snprintf(g_argv[i], strlen("gazebo") + 1, "gazebo");
}
// Register custom message handler
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gazebo.git
More information about the debian-science-commits
mailing list