mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 02:18:53 +00:00
Merge pull request #430 from theopolis/fix-biging
Check tables row vector size before access
This commit is contained in:
commit
0cb30d8ccb
@ -72,6 +72,7 @@ int {{table_name_cc}}Column(
|
||||
{% for col in schema %}\
|
||||
// {{ col.name }}
|
||||
case {{ loop.index0 }}:
|
||||
if (pVtab->pContent->xCol_{{col.name}}.size() > pCur->row) {
|
||||
{% if col.type.affinity == "TEXT" %}\
|
||||
sqlite3_result_text(
|
||||
ctx,
|
||||
@ -92,6 +93,7 @@ int {{table_name_cc}}Column(
|
||||
({{col.type.type}})pVtab->pContent->xCol_{{col.name}}[pCur->row]
|
||||
);
|
||||
{% endif %}\
|
||||
}
|
||||
break;
|
||||
{% endfor %}\
|
||||
}
|
||||
@ -134,7 +136,7 @@ int {{table_name_cc}}Filter(
|
||||
pVtab->pContent->xCol_{{col.name}}.push_back(-1);
|
||||
}
|
||||
{% endif %}\
|
||||
{% if col.type == "BIGINT" %}\
|
||||
{% if col.type.affinity == "BIGINT" %}\
|
||||
try {
|
||||
pVtab->pContent->xCol_{{col.name}}\
|
||||
.push_back(boost::lexical_cast<{{col.type.type}}>(row["{{col.name}}"]));
|
||||
|
Loading…
Reference in New Issue
Block a user