mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[buf] Ensure section name do not overflow buffer
IFF section name will become 127+ symbols length, overflow of buffer is possible. Ensure buffer is always zero-terminated and no overrun occured.
This commit is contained in:
		
							parent
							
								
									e892c58334
								
							
						
					
					
						commit
						802f7d7523
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		
							
								
								
									
										7
									
								
								src/ui.c
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								src/ui.c
									
										
									
									
									
								
							|  | @ -563,8 +563,11 @@ void SetSectionHeaders(HWND hDlg) | ||||||
| 		memset(wtmp, 0, sizeof(wtmp)); | 		memset(wtmp, 0, sizeof(wtmp)); | ||||||
| 		GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp)); | 		GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp)); | ||||||
| 		wlen = wcslen(wtmp); | 		wlen = wcslen(wtmp); | ||||||
| 		wtmp[wlen++] = L' '; | 		if (wlen < ARRAYSIZE(wtmp) - 1) | ||||||
| 		wtmp[wlen++] = L' '; | 			wtmp[wlen++] = L' '; | ||||||
|  | 		if (wlen < ARRAYSIZE(wtmp) - 1) | ||||||
|  | 			wtmp[wlen++] = L' '; | ||||||
|  | 		wtmp[ARRAYSIZE(wtmp) - 1] = L'\0'; | ||||||
| 		SetWindowTextW(hCtrl, wtmp); | 		SetWindowTextW(hCtrl, wtmp); | ||||||
| 		GetWindowRect(hCtrl, &rc); | 		GetWindowRect(hCtrl, &rc); | ||||||
| 		MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); | 		MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue