17-undefined-behavior-strcpy.patch 560 B

123456789101112131415161718
  1. Author: Fabian Greffrath <fabian+debian@greffrath.com>
  2. Description: Avoid undefined behaviour when strcpy(3) is
  3. called with the same pointer as source and destination.
  4. Thanks, Jakub Wilk.
  5. Bug-Debian: https://bugs.debian.org/775132
  6. --- a/source/base/all/lfn/lfn.c
  7. +++ b/source/base/all/lfn/lfn.c
  8. @@ -30,8 +30,6 @@ INT BASE_LFN_ChangeDir(PCHAR Directo
  9. PCHAR BASE_LFN_GetCurrentDir(PCHAR Directory, size_t Size)
  10. {
  11. Directory = (PCHAR) getcwd(Directory, Size);
  12. -
  13. - strcpy(Directory, BASE_LFN_LongName(Directory));
  14. return Directory;
  15. }