File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -1964,19 +1964,28 @@ Return Value:
1964
1964
{
1965
1965
1966
1966
PSTR MnemonicSuffix ;
1967
+ INT Result ;
1967
1968
1968
1969
MnemonicSuffix = DbgpArmGetLoadStoreTypeString (Context -> Instruction );
1969
1970
sprintf (Context -> Mnemonic , "%s%s" , ARM_SRS_MNEMONIC , MnemonicSuffix );
1970
1971
DbgpArmPrintMode (Context -> Operand2 , Context -> Instruction );
1971
1972
if ((Context -> Instruction & ARM_WRITE_BACK_BIT ) != 0 ) {
1972
- sprintf (Context -> Operand1 , "%s!, %s" ,
1973
- DbgArmRegisterNames [ARM_STACK_REGISTER ],
1974
- Context -> Operand2 );
1973
+ Result = snprintf (Context -> Operand1 ,
1974
+ sizeof (Context -> Operand1 ),
1975
+ "%s!, %s" ,
1976
+ DbgArmRegisterNames [ARM_STACK_REGISTER ],
1977
+ Context -> Operand2 );
1975
1978
1976
1979
} else {
1977
- sprintf (Context -> Operand1 , "%s, %s" ,
1978
- DbgArmRegisterNames [ARM_STACK_REGISTER ],
1979
- Context -> Operand2 );
1980
+ Result = snprintf (Context -> Operand1 ,
1981
+ sizeof (Context -> Operand1 ),
1982
+ "%s, %s" ,
1983
+ DbgArmRegisterNames [ARM_STACK_REGISTER ],
1984
+ Context -> Operand2 );
1985
+ }
1986
+
1987
+ if (Result < 0 ) {
1988
+ Context -> Operand1 [0 ] = '\0' ;
1980
1989
}
1981
1990
1982
1991
Context -> Operand2 [0 ] = '\0' ;
Original file line number Diff line number Diff line change @@ -609,7 +609,7 @@ Return Value:
609
609
PSTR OutPathBuffer ;
610
610
size_t OutPathSize ;
611
611
ULONG Ratio ;
612
- CHAR RatioString [6 ];
612
+ CHAR RatioString [32 ];
613
613
PCSTR Search ;
614
614
INT Status ;
615
615
Original file line number Diff line number Diff line change @@ -264,7 +264,11 @@ Return Value:
264
264
265
265
Description = & (Results [ResultCount ]);
266
266
memset (Description , 0 , sizeof (SETUP_PARTITION_DESCRIPTION ));
267
- snprintf (Path , sizeof (Path ), "/dev/%s" , Device );
267
+ Status = snprintf (Path , sizeof (Path ), "/dev/%s" , Device );
268
+ if (Status < 0 ) {
269
+ Status = EINVAL ;
270
+ goto OsEnumerateDevicesEnd ;
271
+ }
268
272
269
273
//
270
274
// Figure out if this thing is a partition or a disk. If no entry is
You can’t perform that action at this time.
0 commit comments