Commits

temp...@630680e5-0e50-0410-840e-4b1c322b438d  committed c568396

Fix startup crash when statically linking on Mac.

  • Participants
  • Parent commits 8c61769

Comments (0)

Files changed (1)

File src/google/protobuf/descriptor_database.cc

     return false;
   }
 
-  string path = file.package();
+  // We must be careful here -- calling file.package() if file.has_package() is
+  // false could access an uninitialized static-storage variable if we are being
+  // run at startup time.
+  string path = file.has_package() ? file.package() : string();
   if (!path.empty()) path += '.';
 
   for (int i = 0; i < file.message_type_size(); i++) {