From 91b1910b86c86f41cf7cedc911fe63d304e44403 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 16 May 2014 10:28:21 -0700 Subject: [PATCH] Explicitly null-terminate a string --- interface/src/ui/NodeBounds.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/NodeBounds.cpp b/interface/src/ui/NodeBounds.cpp index e1e37fe21b..40ae606733 100644 --- a/interface/src/ui/NodeBounds.cpp +++ b/interface/src/ui/NodeBounds.cpp @@ -223,8 +223,10 @@ void NodeBounds::drawOverlay() { const int BACKGROUND_OFFSET_Y = -20; const int BACKGROUND_BEVEL = 3; - char textData[_overlayText.length() + 1]; + int textLength = _overlayText.length(); + char textData[textLength + 1]; strcpy(textData, _overlayText.toLatin1().constData()); + textData[textLength] = '\0'; int mouseX = application->getMouseX(), mouseY = application->getMouseY(),