2
0
Эх сурвалжийг харах

- readln(<pchar>) forbidden, there is no way to prevent an buffer overflow, fixes 4227

git-svn-id: trunk@810 -
florian 20 жил өмнө
parent
commit
2f8fe7d2e6

+ 1 - 0
.gitattributes

@@ -5496,6 +5496,7 @@ tests/webtbf/tw4111.pp svneol=native#text/plain
 tests/webtbf/tw4139.pp svneol=native#text/plain
 tests/webtbf/tw4144.pp svneol=native#text/plain
 tests/webtbf/tw4153.pp svneol=native#text/plain
+tests/webtbf/tw4227.pp svneol=native#text/plain
 tests/webtbf/tw4256.pp svneol=native#text/plain
 tests/webtbf/uw0744.pp svneol=native#text/plain
 tests/webtbf/uw0840a.pp svneol=native#text/plain

+ 1 - 1
compiler/ninl.pas

@@ -597,7 +597,7 @@ implementation
                     end;
                   pointerdef :
                     begin
-                      if not is_pchar(para.left.resulttype.def) then
+                      if (not is_pchar(para.left.resulttype.def)) or do_read then
                         begin
                           CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
                           error_para := true;

+ 7 - 0
tests/webtbf/tw4227.pp

@@ -0,0 +1,7 @@
+{ %FAIL }
+var
+  p : pchar;
+
+begin
+  readln(p);
+end.