Hi Liming, Where is the BugZillar link? I will try if I can submit it. But not sure where I can quickly apply for an account.
At 2017-01-25 08:54:47, "Gao, Liming" <liming....@intel.com> wrote: >Xiaofeng: > Yes. This is a potential issue. This API should be updated with original > Buffer Size. Could you help submit this issue in BugZillar? > >Thanks >Liming >>-----Original Message----- >>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >>wang xiaofeng >>Sent: Tuesday, January 24, 2017 3:56 PM >>To: edk2-devel@lists.01.org; Dong, Eric <eric.d...@intel.com> >>Subject: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe >> >>Hi DisplayEngineDxe Owner, >> SetUnicodeMem seems unsafe since the buffer may overflow if the input >>Size is bigger than buffer size.Do we think about improve the function >> >> >>/** >> Set Buffer to Value for Size bytes. >> >> >> @param Buffer Memory to set. >> @param Size Number of bytes to set >> @param Value Value of the set operation. >> >> >>**/ >>VOID >>SetUnicodeMem ( >> IN VOID *Buffer, >> IN UINTN Size, >> IN CHAR16 Value >> ) >>{ >> CHAR16 *Ptr; >> >> >> Ptr = Buffer; >> while ((Size--) != 0) { >> *(Ptr++) = Value; >> } >>} >> >> The problem I meet is liking the following screen. Year in main page shows >>incorrect char randomly. >> >> If I turn off GetNumericInput optimize with #pragma optimize( "", off ) in >>InputHandler.c , or swtich to use StrCpyS like this. The problem disappear. >>This >>issue cannot be seen in OVMF ,but it can be reproduced in our own platform >>with a rate of 30%. >> >> >> >>_______________________________________________ >>edk2-devel mailing list >>edk2-devel@lists.01.org >>https://lists.01.org/mailman/listinfo/edk2-devel >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel