[ox/fs] Fix segfault in FileAddress
This commit is contained in:
		
							
								
								
									
										11
									
								
								deps/ox/src/ox/fs/filesystem/filelocation.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								deps/ox/src/ox/fs/filesystem/filelocation.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -45,9 +45,14 @@ FileAddress &FileAddress::operator=(const FileAddress &other) noexcept { | ||||
| 	switch (m_type) { | ||||
| 		case FileAddressType::Path: | ||||
| 		{ | ||||
| 			auto strSize = ox_strlen(other.m_data.path) + 1; | ||||
| 			m_data.path = new char[strSize]; | ||||
| 			ox_memcpy(m_data.path, other.m_data.path, strSize); | ||||
| 			if (other.m_data.path) { | ||||
| 				auto strSize = ox_strlen(other.m_data.path) + 1; | ||||
| 				m_data.path = new char[strSize]; | ||||
| 				ox_memcpy(m_data.path, other.m_data.path, strSize); | ||||
| 			} else { | ||||
| 				m_data.constPath = ""; | ||||
| 				m_type = FileAddressType::ConstPath; | ||||
| 			} | ||||
| 			break; | ||||
| 		} | ||||
| 		case FileAddressType::ConstPath: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user