Index: util/mach/child_port_handshake.cc |
diff --git a/util/mach/child_port_handshake.cc b/util/mach/child_port_handshake.cc |
index eedcf47b267fb6e477017fe42bee221c82ce6b38..efe1ea8a7ae0be7762249cef3ca22e9a53402ce9 100644 |
--- a/util/mach/child_port_handshake.cc |
+++ b/util/mach/child_port_handshake.cc |
@@ -319,8 +319,8 @@ void ChildPortHandshake::RunClientInternal_ReadPipe(int pipe_read, |
DCHECK_LT(service_name_length, |
implicit_cast<uint32_t>(BOOTSTRAP_MAX_NAME_LEN)); |
- if (service_name_length > 0) { |
- service_name->resize(service_name_length); |
+ service_name->resize(service_name_length); |
+ if (!service_name->empty()) { |
CheckedReadFile(pipe_read, &(*service_name)[0], service_name_length); |
} |
} |