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
				
			
		
							
								
								
									
										3
									
								
								src/ui.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								src/ui.c
									
										
									
									
									
								
							|  | @ -563,8 +563,11 @@ void SetSectionHeaders(HWND hDlg) | |||
| 		memset(wtmp, 0, sizeof(wtmp)); | ||||
| 		GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp)); | ||||
| 		wlen = wcslen(wtmp); | ||||
| 		if (wlen < ARRAYSIZE(wtmp) - 1) | ||||
| 			wtmp[wlen++] = L' '; | ||||
| 		if (wlen < ARRAYSIZE(wtmp) - 1) | ||||
| 			wtmp[wlen++] = L' '; | ||||
| 		wtmp[ARRAYSIZE(wtmp) - 1] = L'\0'; | ||||
| 		SetWindowTextW(hCtrl, wtmp); | ||||
| 		GetWindowRect(hCtrl, &rc); | ||||
| 		MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue