Commit ac1098d1 authored by Bill King's avatar Bill King
Browse files

Fixes possible buffer overflow situation.

parent c81ddf8f
......@@ -3432,14 +3432,14 @@ void GdbEngine::rebuildWatchModel()
static QByteArray arrayFillCommand(const char *array, const QByteArray &params)
char buf[50];
sprintf(buf, "set {char[%d]} &%s = {", params.size(), array);
QString buf;
buf.sprintf("set {char[%d]} &%s = {", params.size(), array);
QByteArray encoded;
const int size = params.size();
for (int i = 0; i != size; ++i) {
sprintf(buf, "%d,", int(params[i]));
buf.sprintf("%d,", int(params[i]));
encoded[encoded.size() - 1] = '}';
return encoded;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment