浏览代码

Add a check for embedded octal characters not overflowing

mingodad 8 年之前
父节点
当前提交
79b78d4da1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      SquiLu/squirrel/sqlexer.cpp

+ 2 - 1
SquiLu/squirrel/sqlexer.cpp

@@ -670,7 +670,8 @@ try_again:
                                 ++ndigits;
                                 ++ndigits;
                                 NEXT();
                                 NEXT();
                             }
                             }
-                            if(ndigits > 3) return Error(_SC("max number of octal digits is 3"));
+                            if(ndigits > 3) return Error(_SC("max number of embedded octal digits is 3"));
+                            if(octal_char > 0xff) return Error(_SC("max value of embedded octal digits is \377"));
                             APPEND_CHAR(octal_char);
                             APPEND_CHAR(octal_char);
                             goto try_again;
                             goto try_again;
 					    }
 					    }