mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-07 22:32:05 +00:00
Skip initializer processing for flexible array members.
This could result in null pointer dereferences.
This commit is contained in:
parent
cb063afa47
commit
4db26d14bd
@ -3940,6 +3940,8 @@ var
|
|||||||
2: end;
|
2: end;
|
||||||
|
|
||||||
arrayType: begin
|
arrayType: begin
|
||||||
|
elements := itype^.elements;
|
||||||
|
if elements = 0 then goto 1; {don't init flexible array member}
|
||||||
if itype^.aType^.kind = scalarType then
|
if itype^.aType^.kind = scalarType then
|
||||||
if itype^.aType^.baseType in [cgByte,cgUByte] then
|
if itype^.aType^.baseType in [cgByte,cgUByte] then
|
||||||
if iPtr^.iTree^.token.kind = stringConst then begin
|
if iPtr^.iTree^.token.kind = stringConst then begin
|
||||||
@ -3955,7 +3957,6 @@ var
|
|||||||
iPtr := iPtr^.next;
|
iPtr := iPtr^.next;
|
||||||
goto 1;
|
goto 1;
|
||||||
end; {if}
|
end; {if}
|
||||||
elements := itype^.elements;
|
|
||||||
itype := itype^.atype;
|
itype := itype^.atype;
|
||||||
if ZeroFill(elements, itype, count, iPtr) then begin
|
if ZeroFill(elements, itype, count, iPtr) then begin
|
||||||
if itype^.kind = enumType then
|
if itype^.kind = enumType then
|
||||||
|
Loading…
Reference in New Issue
Block a user