File: 17-undefined-behavior-strcpy.patch

package info (click to toggle)
unace-nonfree 2.5-9
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 1,852 kB
  • ctags: 3,601
  • sloc: ansic: 14,590; makefile: 47; sh: 32; cpp: 21
file content (17 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Author: Fabian Greffrath <fabian+debian@greffrath.com>
Description: Avoid undefined behaviour when strcpy(3) is
 called with the same pointer as source and destination.
 Thanks, Jakub Wilk.
Bug-Debian: https://bugs.debian.org/775132

--- a/source/base/all/lfn/lfn.c
+++ b/source/base/all/lfn/lfn.c
@@ -30,8 +30,6 @@ INT     BASE_LFN_ChangeDir(PCHAR Directo
 PCHAR   BASE_LFN_GetCurrentDir(PCHAR Directory, size_t Size)
 {
   Directory = (PCHAR) getcwd(Directory, Size);
-  
-  strcpy(Directory, BASE_LFN_LongName(Directory));
 
   return Directory;
 }