Add security check and resize on vector-returning functions where the size of the vector is queried from vulkan, and the size can potentially change between querying the size and querying the data. (#18)

This commit is contained in:
Andreas Süßenbach
2016-08-09 11:33:30 +02:00
committed by Markus Tavenrath
parent 633182bbc0
commit 73857ee1dd
2 changed files with 29 additions and 1 deletions

View File

@@ -2073,7 +2073,9 @@ void writeFunctionBody(std::ofstream & ofs, std::string const& indentation, std:
ofs << indentation << localIndentation << "}" << std::endl;
if (1 < commandData.successCodes.size())
{
ofs << indentation << " } while ( result == Result::eIncomplete );" << std::endl;
ofs << indentation << " } while ( result == Result::eIncomplete );" << std::endl
<< indentation << " assert( " << reduceName(commandData.arguments[returnit->second].name) << " <= " << reduceName(commandData.arguments[returnit->first].name) << ".size() ); " << std::endl
<< indentation << " " << reduceName(commandData.arguments[returnit->first].name) << ".resize( " << reduceName(commandData.arguments[returnit->second].name) << " ); " << std::endl;
}
}
}