Merge pull request #21 from sundhaug92/master
GDB: Range-checking for 'p' and 'P' ops
This commit is contained in:
commit
b80ea69a12
|
@ -3945,6 +3945,11 @@ void remoteReadRegister(char* p)
|
|||
{
|
||||
int r;
|
||||
sscanf(p, "%x", &r);
|
||||
if(r < 0 || r > 15)
|
||||
{
|
||||
remotePutPacket("E 00");
|
||||
return;
|
||||
}
|
||||
char buffer[1024];
|
||||
char* s = buffer;
|
||||
uint32_t v = reg[r].I;
|
||||
|
@ -3997,6 +4002,12 @@ void remoteWriteRegister(char* p)
|
|||
|
||||
sscanf(p, "%x=", &r);
|
||||
|
||||
if(r < 0 || r > 15)
|
||||
{
|
||||
remotePutPacket("E 00");
|
||||
return;
|
||||
}
|
||||
|
||||
p = strchr(p, '=');
|
||||
p++;
|
||||
|
||||
|
|
Loading…
Reference in New Issue