@@ -1205,6 +1205,9 @@ void pe_parse_certificates(
1205
1205
1206
1206
if (serial_der != NULL )
1207
1207
{
1208
+ unsigned char * serial_bytes ;
1209
+ char * serial_ascii ;
1210
+
1208
1211
bytes = i2d_ASN1_INTEGER (serial , & serial_der );
1209
1212
1210
1213
// i2d_ASN1_INTEGER() moves the pointer as it writes into
@@ -1213,7 +1216,7 @@ void pe_parse_certificates(
1213
1216
serial_der -= bytes ;
1214
1217
1215
1218
// Skip over DER type, length information
1216
- unsigned char * serial_bytes = serial_der + 2 ;
1219
+ serial_bytes = serial_der + 2 ;
1217
1220
bytes -= 2 ;
1218
1221
1219
1222
// Also allocate space to hold the "common" string format:
@@ -1224,7 +1227,7 @@ void pe_parse_certificates(
1224
1227
// The last one doesn't have the colon, but the extra byte is used
1225
1228
// for the NULL terminator.
1226
1229
1227
- char * serial_ascii = (char * ) yr_malloc (bytes * 3 );
1230
+ serial_ascii = (char * ) yr_malloc (bytes * 3 );
1228
1231
1229
1232
if (serial_ascii )
1230
1233
{
@@ -1235,14 +1238,14 @@ void pe_parse_certificates(
1235
1238
// Don't put the colon on the last one.
1236
1239
if (j < bytes - 1 )
1237
1240
snprintf (
1238
- ( char * ) serial_ascii + 3 * j , 4 , "%02x:" , serial_bytes [j ]);
1241
+ serial_ascii + 3 * j , 4 , "%02x:" , serial_bytes [j ]);
1239
1242
else
1240
1243
snprintf (
1241
- ( char * ) serial_ascii + 3 * j , 3 , "%02x" , serial_bytes [j ]);
1244
+ serial_ascii + 3 * j , 3 , "%02x" , serial_bytes [j ]);
1242
1245
}
1243
1246
1244
1247
set_string (
1245
- ( char * ) serial_ascii ,
1248
+ serial_ascii ,
1246
1249
pe -> object ,
1247
1250
"signatures[%i].serial" ,
1248
1251
counter );
0 commit comments