[CONSOLE]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 24 Oct 2015 07:59:52 +0000 (07:59 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 24 Oct 2015 07:59:52 +0000 (07:59 +0000)
Don't overrun two buffers

CID 13221001237057

svn path=/trunk/; revision=69660

reactos/dll/cpl/console/font.c

index 79c582a..86683f5 100644 (file)
@@ -305,7 +305,7 @@ FontTypeChange(HWND hwndDlg,
                                       LB_GETTEXT, nSel, (LPARAM)FaceName);
     FaceName[Length] = '\0';
 
                                       LB_GETTEXT, nSel, (LPARAM)FaceName);
     FaceName[Length] = '\0';
 
-    Length = min(Length/*wcslen(FaceName) + 1*/, LF_FACESIZE); // wcsnlen
+    Length = min(Length/*wcslen(FaceName) + 1*/, LF_FACESIZE - 1); // wcsnlen
     wcsncpy(pConInfo->FaceName, FaceName, LF_FACESIZE);
     pConInfo->FaceName[Length] = L'\0';
     DPRINT1("pConInfo->FaceName = '%S'\n", pConInfo->FaceName);
     wcsncpy(pConInfo->FaceName, FaceName, LF_FACESIZE);
     pConInfo->FaceName[Length] = L'\0';
     DPRINT1("pConInfo->FaceName = '%S'\n", pConInfo->FaceName);