Index: runtime/bin/utils_linux.cc |
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc |
index e8230c89b4da30061e83dbb33ac39fc5564845de..66e6929371936be9c7595e94f094a8fab0acdc06 100644 |
--- a/runtime/bin/utils_linux.cc |
+++ b/runtime/bin/utils_linux.cc |
@@ -19,7 +19,9 @@ namespace bin { |
OSError::OSError() : sub_system_(kSystem), code_(0), message_(NULL) { |
set_sub_system(kSystem); |
set_code(errno); |
- SetMessage(strerror(errno)); |
+ const int kBufferSize = 1024; |
+ char error_buf[kBufferSize]; |
+ SetMessage(strerror_r(errno, error_buf, kBufferSize)); |
} |
@@ -27,7 +29,9 @@ void OSError::SetCodeAndMessage(SubSystem sub_system, int code) { |
set_sub_system(sub_system); |
set_code(code); |
if (sub_system == kSystem) { |
- SetMessage(strerror(code)); |
+ const int kBufferSize = 1024; |
+ char error_buf[kBufferSize]; |
+ SetMessage(strerror_r(code, error_buf, kBufferSize)); |
} else if (sub_system == kGetAddressInfo) { |
SetMessage(gai_strerror(code)); |
} else { |