Commit a0d437af authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Don't change the size of an array in-parameter

Avoid a possible memory issue while the resize of an array reference is
possible, the new length can't be propagated back to the caller.

Issue an warning for unexpected string lengths.
parent 9c130ffe
......@@ -114,8 +114,9 @@ public class Valadoc.MarkupWriter {
check_column (name);
if (attributes.length % 2 != 0) {
attributes.resize (attributes.length+1);
attributes[attributes.length-1] = "";
warning ("Given attributes array is not a list of pairs (name and value)");
// This only effects array length of this in-parameter in this scope
attributes.length -= 1;
}
var content = new StringBuilder ("<");
......@@ -144,8 +145,9 @@ public class Valadoc.MarkupWriter {
check_column (name);
if (attributes.length % 2 != 0) {
attributes.resize (attributes.length+1);
attributes[attributes.length-1] = "";
warning ("Given attributes array is not a list of pairs (name and value)");
// This only effects array length of this in-parameter in this scope
attributes.length -= 1;
}
var content = new StringBuilder ("<");
......
Markdown is supported
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