These two issues make sense, but there are probably others.
#include "support/unique_ptr.h"
#include <cstring>
+#include <iomanip>
#include <iostream>
#include <limits>
#include <sstream>
cur.recordUndoInset(this);
istringstream is(argument);
+ // limit the size of strings we read to avoid memory problems
+ is >> setw(65636);
string s;
// Safe guard.
size_t safe_guard = 0;
}
ifstream fs(filename.toFilesystemEncoding().c_str());
+ // limit the size of strings we read to avoid memory problems
+ fs >> setw(65636);
string line;
bool skip = false;
while (getline(fs, line)) {
// special case of iffont/else/endif
if (line.size() >= 7 && line.substr(0, 6) == "iffont") {
istringstream is(line);
+ // limit the size of strings we read to avoid memory problems
+ is >> setw(65636);
string tmp;
is >> tmp;
is >> tmp;