[dlls/dsound/capture.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:50:06 CST 2005


It is not obviously whether Drvname must be \0 terminated if
it is larger than sizeof(array). Grepping for Drvname shows a
lot of strcpy without lenght limitation.


Changelog:
	Change a strncpy to lstrcpyA.

Index: dlls/dsound/capture.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/capture.c,v
retrieving revision 1.46
diff -u -r1.46 capture.c
--- dlls/dsound/capture.c	16 Mar 2005 11:30:17 -0000	1.46
+++ dlls/dsound/capture.c	26 Mar 2005 09:40:26 -0000
@@ -567,8 +567,8 @@

             if (err == DS_OK) {
                 This->drvcaps.dwFlags = 0;
-                strncpy(This->drvdesc.szDrvname, wic.szPname,
-                    sizeof(This->drvdesc.szDrvname));
+                lstrcpynA(This->drvdesc.szDrvname, wic.szPname,
+                          sizeof(This->drvdesc.szDrvname));

                 This->drvcaps.dwFlags |= DSCCAPS_EMULDRIVER;
                 This->drvcaps.dwFormats = wic.dwFormats;





More information about the wine-patches mailing list