Merge ~mitya57/compiz:format-truncation into compiz:master

Proposed by Dmitry Shachnev
Status: Merged
Approved by: Alberts Muktupāvels
Approved revision: c5e37978f88f8d1216397376891bbb6237389337
Merged at revision: 917425405594959fb819ba2f5653b6985dc2bb1e
Proposed branch: ~mitya57/compiz:format-truncation
Merge into: compiz:master
Diff against target: 24 lines (+3/-3)
1 file modified
plugins/opengl/src/vertexbuffer.cpp (+3/-3)
Reviewer Review Type Date Requested Status
Alberts Muktupāvels Approve
Review via email: mp+410700@code.launchpad.net

Commit message

Increase string buffer size to fix GCC format-truncation error.

To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) :
review: Approve
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This can be merged IMO. Nice catch from the compiler side :-).

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

It is not merged only because Ubuntu upload got stuck in proposed queue. I will try to use some force.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plugins/opengl/src/vertexbuffer.cpp b/plugins/opengl/src/vertexbuffer.cpp
2index 4bcacfc..b102016 100644
3--- a/plugins/opengl/src/vertexbuffer.cpp
4+++ b/plugins/opengl/src/vertexbuffer.cpp
5@@ -563,9 +563,9 @@ int PrivateVertexBuffer::render (const GLMatrix *projection,
6
7 for (int i = nTextures - 1; i >= 0; i--)
8 {
9- char name[10];
10+ char name[19];
11
12- snprintf (name, 10, "texCoord%d", i);
13+ snprintf (name, 19, "texCoord%d", i);
14 texCoordIndex[i] = tmpProgram->attributeLocation (name);
15
16 (*GL::enableVertexAttribArray) (texCoordIndex[i]);
17@@ -573,7 +573,7 @@ int PrivateVertexBuffer::render (const GLMatrix *projection,
18 (*GL::vertexAttribPointer) (texCoordIndex[i], 2, GL_FLOAT, GL_FALSE, 0, 0);
19 (*GL::bindBuffer) (GL::ARRAY_BUFFER, 0);
20
21- snprintf (name, 9, "texture%d", i);
22+ snprintf (name, 18, "texture%d", i);
23 tmpProgram->setUniform (name, i);
24 }
25

Subscribers

People subscribed via source and target branches