SHA256
1
0
forked from pool/wine
wine/0001-shell32-replace-strcpy-by-memcpy-due-to-slightly-und.patch

35 lines
1.0 KiB
Diff

From 90d67c1a637fd0804fc7e9eaacaf3b0e2e863e17 Mon Sep 17 00:00:00 2001
From: Marcus Meissner <meissner@suse.de>
Date: Mon, 15 Feb 2010 17:23:05 +0100
Subject: [PATCH 1/2] shell32: replace strcpy by memcpy due to slightly undefined struct handling
Hi,
Writing over the end of a struct is only clearly defined if the struct
is standalone and not contained in another.
So for gcc 4.5 the strcpy triggers a fortify overflow error and we
better use memcpy.
Ciao, Marcus
---
dlls/shell32/pidl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index 3e61144..a7704b3 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -1606,7 +1606,7 @@ LPITEMIDLIST _ILCreateEntireNetwork(void)
LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
pData->u.network.dummy = 0;
- strcpy(pData->u.network.szNames, "Entire Network");
+ memcpy(pData->u.network.szNames, "Entire Network", sizeof("Entire Network")+1);
}
return pidlOut;
}
--
1.6.6.1