diff --git a/common/subprocess.cc b/common/subprocess.cc
index 023017b..a0cb9a7 100644
--- a/common/subprocess.cc
+++ b/common/subprocess.cc
@@ -124,7 +124,7 @@
     bool eof;
     bool ok = utils::ReadAll(
         record->stdout_fd, buf, base::size(buf), &bytes_read, &eof);
-    record->stdout.append(buf, bytes_read);
+    record->stdout_str.append(buf, bytes_read);
     if (!ok || eof) {
       // There was either an error or an EOF condition, so we are done watching
       // the file descriptor.
@@ -152,11 +152,11 @@
     LOG(INFO) << "Subprocess exited with si_status: " << info.si_status;
   }
 
-  if (!record->stdout.empty()) {
-    LOG(INFO) << "Subprocess output:\n" << record->stdout;
+  if (!record->stdout_str.empty()) {
+    LOG(INFO) << "Subprocess output:\n" << record->stdout_str;
   }
   if (!record->callback.is_null()) {
-    record->callback.Run(info.si_status, record->stdout);
+    record->callback.Run(info.si_status, record->stdout_str);
   }
   // Release and close all the pipes after calling the callback so our
   // redirected pipes are still alive. Releasing the process first makes
@@ -230,29 +230,30 @@
 
 bool Subprocess::SynchronousExec(const vector<string>& cmd,
                                  int* return_code,
-                                 string* stdout,
-                                 string* stderr) {
+                                 string* stdout_str,
+                                 string* stderr_str) {
   // The default for |SynchronousExec| is to use |kSearchPath| since the code
   // relies on that.
-  return SynchronousExecFlags(cmd, kSearchPath, return_code, stdout, stderr);
+  return SynchronousExecFlags(
+      cmd, kSearchPath, return_code, stdout_str, stderr_str);
 }
 
 bool Subprocess::SynchronousExecFlags(const vector<string>& cmd,
                                       uint32_t flags,
                                       int* return_code,
-                                      string* stdout,
-                                      string* stderr) {
+                                      string* stdout_str,
+                                      string* stderr_str) {
   brillo::ProcessImpl proc;
   if (!LaunchProcess(cmd, flags, {STDERR_FILENO}, &proc)) {
     LOG(ERROR) << "Failed to launch subprocess";
     return false;
   }
 
-  if (stdout) {
-    stdout->clear();
+  if (stdout_str) {
+    stdout_str->clear();
   }
-  if (stderr) {
-    stderr->clear();
+  if (stderr_str) {
+    stderr_str->clear();
   }
 
   // Read from both stdout and stderr individually.
@@ -267,8 +268,8 @@
         stdout_closed = true;
         if (rc < 0)
           PLOG(ERROR) << "Reading from child's stdout";
-      } else if (stdout != nullptr) {
-        stdout->append(buffer.data(), rc);
+      } else if (stdout_str != nullptr) {
+        stdout_str->append(buffer.data(), rc);
       }
     }
 
@@ -278,8 +279,8 @@
         stderr_closed = true;
         if (rc < 0)
           PLOG(ERROR) << "Reading from child's stderr";
-      } else if (stderr != nullptr) {
-        stderr->append(buffer.data(), rc);
+      } else if (stderr_str != nullptr) {
+        stderr_str->append(buffer.data(), rc);
       }
     }
   }
@@ -299,9 +300,9 @@
       SubprocessRecord* record = pid_record.second.get();
       // Make sure we read any remaining process output.
       OnStdoutReady(record);
-      if (!record->stdout.empty()) {
+      if (!record->stdout_str.empty()) {
         LOG(INFO) << "Subprocess(" << pid_record.first << ") output:\n"
-                  << record->stdout;
+                  << record->stdout_str;
       }
     }
   }
diff --git a/common/subprocess.h b/common/subprocess.h
index 2ed8b81..e59776a 100644
--- a/common/subprocess.h
+++ b/common/subprocess.h
@@ -91,18 +91,18 @@
   // |output_pipes|, otherwise returns -1.
   int GetPipeFd(pid_t pid, int fd) const;
 
-  // Executes a command synchronously. Returns true on success. If |stdout| is
-  // non-null, the process output is stored in it, otherwise the output is
+  // Executes a command synchronously. Returns true on success. If |stdout_str|
+  // is non-null, the process output is stored in it, otherwise the output is
   // logged.
   static bool SynchronousExec(const std::vector<std::string>& cmd,
                               int* return_code,
-                              std::string* stdout,
-                              std::string* stderr);
+                              std::string* stdout_str,
+                              std::string* stderr_str);
   static bool SynchronousExecFlags(const std::vector<std::string>& cmd,
                                    uint32_t flags,
                                    int* return_code,
-                                   std::string* stdout,
-                                   std::string* stderr);
+                                   std::string* stdout_str,
+                                   std::string* stderr_str);
 
   // Gets the one instance.
   static Subprocess& Get() { return *subprocess_singleton_; }
@@ -131,7 +131,7 @@
     std::unique_ptr<base::FileDescriptorWatcher::Controller> stdout_controller;
 
     int stdout_fd{-1};
-    std::string stdout;
+    std::string stdout_str;
   };
 
   // Callback which runs whenever there is input available on the subprocess
diff --git a/payload_generator/squashfs_filesystem.cc b/payload_generator/squashfs_filesystem.cc
index a41e283..16b26eb 100644
--- a/payload_generator/squashfs_filesystem.cc
+++ b/payload_generator/squashfs_filesystem.cc
@@ -76,12 +76,12 @@
   // Run unsquashfs to get the system file map.
   // unsquashfs -m <map-file> <squashfs-file>
   vector<string> cmd = {"unsquashfs", "-m", map_file.path(), sqfs_path};
-  string stdout, stderr;
+  string stdout_str, stderr_str;
   int exit_code;
-  if (!Subprocess::SynchronousExec(cmd, &exit_code, &stdout, &stderr) ||
+  if (!Subprocess::SynchronousExec(cmd, &exit_code, &stdout_str, &stderr_str) ||
       exit_code != 0) {
     LOG(ERROR) << "Failed to run `unsquashfs -m` with stdout content: "
-               << stdout << " and stderr content: " << stderr;
+               << stdout_str << " and stderr content: " << stderr_str;
     return false;
   }
   TEST_AND_RETURN_FALSE(utils::ReadFile(map_file.path(), map));
@@ -104,12 +104,12 @@
                         unsquash_dir.GetPath().value(),
                         sqfs_path,
                         kUpdateEngineConf};
-  string stdout, stderr;
+  string stdout_str, stderr_str;
   int exit_code;
-  if (!Subprocess::SynchronousExec(cmd, &exit_code, &stdout, &stderr) ||
+  if (!Subprocess::SynchronousExec(cmd, &exit_code, &stdout_str, &stderr_str) ||
       exit_code != 0) {
     PLOG(ERROR) << "Failed to unsquashfs etc/update_engine.conf with stdout: "
-                << stdout << " and stderr: " << stderr;
+                << stdout_str << " and stderr: " << stderr_str;
     return false;
   }
 
