mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Null-terminate the embedded capybara.js resource string
This commit is contained in:
parent
3f519cd147
commit
2a7d49d503
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,11 @@ WebPage::WebPage(QObject *parent) : QWebPage(parent) {
|
|||
connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()),
|
||||
this, SLOT(injectJavascriptHelpers()));
|
||||
QResource javascript(":/capybara.js");
|
||||
m_capybaraJavascript = QString((const char *) javascript.data());
|
||||
char * javascriptString = new char[javascript.size() + 1];
|
||||
strcpy(javascriptString, (const char *)javascript.data());
|
||||
javascriptString[javascript.size()] = 0;
|
||||
m_capybaraJavascript = javascriptString;
|
||||
delete javascriptString;
|
||||
}
|
||||
|
||||
void WebPage::injectJavascriptHelpers() {
|
||||
|
|
Loading…
Reference in a new issue