File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -759,6 +759,9 @@ static Error caamAes(struct DescStruct* desc)
759759 ctx [ctxIdx ] = buf ;
760760 sz += buf -> dataSz ;
761761
762+ if (ctx [ctxIdx ]-> dataSz + offset > (MAX_CTX * sizeof (UINT4 ))) {
763+ return SizeIsTooLarge ;
764+ }
762765 memcpy ((unsigned char * )& local [offset ],
763766 (unsigned char * )ctx [ctxIdx ]-> data , ctx [ctxIdx ]-> dataSz );
764767 offset += ctx [ctxIdx ]-> dataSz ;
@@ -958,6 +961,9 @@ static Error caamAead(struct DescStruct* desc)
958961 ctx [ctxIdx ] = buf ;
959962 sz += buf -> dataSz ;
960963
964+ if (ctx [ctxIdx ]-> dataSz + offset > (MAX_CTX * sizeof (UINT4 ))) {
965+ return SizeIsTooLarge ;
966+ }
961967 memcpy ((unsigned char * )& local [offset ],
962968 (unsigned char * )ctx [ctxIdx ]-> data , ctx [ctxIdx ]-> dataSz );
963969 offset += ctx [ctxIdx ]-> dataSz ;
You can’t perform that action at this time.
0 commit comments