@@ -380,7 +380,12 @@ - (google_crashlytics_Session_OperatingSystem)protoOperatingSystem {
380380- (google_crashlytics_Session_Device)protoSessionDevice {
381381 google_crashlytics_Session_Device device = google_crashlytics_Session_Device_init_default;
382382 device.arch = [self protoArchitectureFromString: self .executable.architecture];
383- device.model = FIRCLSEncodeString (self.host .model );
383+
384+ NSString *model = [NSString stringWithFormat: @" %@ " , self .host.model] ;
385+ // To test adding an extra byte in another field when we are at the known max size:
386+ // NSString *model = [NSString stringWithFormat:@"%@a", self.host.model];
387+
388+ device.model = FIRCLSEncodeString (model);
384389 device.ram = [self ramUsed ];
385390 device.disk_space = self.storage .total ;
386391 device.language = FIRCLSEncodeString (self.host .locale );
@@ -440,7 +445,7 @@ - (google_crashlytics_Session_Event_Application)protoEventApplicationForCrash {
440445 google_crashlytics_Session_Event_Application_init_default;
441446
442447 app.execution .binaries = [self protoBinaryImages ];
443- app.execution .binaries_count = (pb_size_t )self.binaryImages .count ;
448+ app.execution .binaries_count = 1 ; // (pb_size_t)self.binaryImages.count;
444449 app.execution .signal = [self protoSignal ];
445450 app.execution .threads = [self protoThreadsWithArray: self .threads];
446451 app.execution .threads_count = (pb_size_t )self.threads .count ;
@@ -462,7 +467,7 @@ - (google_crashlytics_Session_Event_Application)protoEventApplicationForError:
462467
463468 // TODO: Filter by binaries by stacktrace, Protobuf.scala:93
464469 app.execution .binaries = [self protoBinaryImages ];
465- app.execution .binaries_count = (pb_size_t )self.binaryImages .count ;
470+ app.execution .binaries_count = 1 ; // (pb_size_t)self.binaryImages.count;
466471
467472 google_crashlytics_Session_Event_Application_Execution_Signal emptySignal =
468473 google_crashlytics_Session_Event_Application_Execution_Signal_init_default;
@@ -579,17 +584,32 @@ - (google_crashlytics_Session_Event_Application_Execution_Signal)protoSignal {
579584}
580585
581586- (google_crashlytics_Session_Event_Application_Execution_BinaryImage *)protoBinaryImages {
587+
588+ NSUInteger size = 1 ;
589+
582590 google_crashlytics_Session_Event_Application_Execution_BinaryImage *images =
583591 malloc (sizeof (google_crashlytics_Session_Event_Application_Execution_BinaryImage) *
584- self. binaryImages . count );
592+ size );
585593
586- for (NSUInteger i = 0 ; i < self. binaryImages . count ; i++) {
594+ for (NSUInteger i = 0 ; i < size ; i++) {
587595 google_crashlytics_Session_Event_Application_Execution_BinaryImage image =
588596 google_crashlytics_Session_Event_Application_Execution_BinaryImage_init_default;
589- image.name = FIRCLSEncodeString (self.binaryImages [i].path );
590- image.uuid = FIRCLSEncodeString (self.binaryImages [i].uuid );
591- image.base_address = self.binaryImages [i].base ;
592- image.size = self.binaryImages [i].size ;
597+
598+ // image.name = FIRCLSEncodeString(self.binaryImages[i].path);
599+ // image.uuid = FIRCLSEncodeString(self.binaryImages[i].uuid);
600+ // image.base_address = self.binaryImages[i].base;
601+ // image.size = self.binaryImages[i].size;
602+
603+ NSMutableString *str = [[NSMutableString alloc ] init ];
604+
605+ // 12090 is the MAX characters with the bare_min_crash crash files with 1 binary image
606+ // before the pb format becomes invalid!
607+ for (NSUInteger i = 0 ; i < 12090 ; i++) {
608+ [str appendString: @" a" ];
609+ }
610+
611+ image.name = FIRCLSEncodeString (str);
612+
593613
594614 // TODO: Fix analysis issue: "Use of zero-allocated memory"
595615 images[i] = image;
0 commit comments