X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathFactory.cpp;h=79ae676fc39b3ddc3d583149fd7d306f41e6d568;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=2cd045b0ccb7930ce32f0a88e94a16083dba433d;hpb=9a013637bbe7c35dc90cb28ff874da99133a1f8b;p=lyx.git diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 2cd045b0cc..79ae676fc3 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -149,6 +149,8 @@ void initSymbols() } 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)) { @@ -160,6 +162,8 @@ void initSymbols() // 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;