mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 07:00:30 +00:00
Fix oobread transfering large packets via qnxr
This commit is contained in:
parent
e60bc5d12c
commit
084064bdf1
@ -151,7 +151,6 @@ int qnxr_connect(libqnxr_t *g, const char *host, int port) {
|
||||
g->connected = 0;
|
||||
g->mid = 0;
|
||||
|
||||
|
||||
memmove (g->host, host, strlen (host) + 1);
|
||||
g->port = port;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* libqnxr - GPL - Copyright 2014-2016 - defragger, madprogrammer */
|
||||
/* libqnxr - GPL - Copyright 2014-2022 - pancake, defragger, madprogrammer */
|
||||
|
||||
#include <errno.h>
|
||||
#include "packet.h"
|
||||
@ -155,6 +155,10 @@ int qnxr_send_packet (libqnxr_t *g) {
|
||||
p = g->send_buff;
|
||||
*p++ = FRAME_CHAR;
|
||||
|
||||
if (g->send_len >= sizeof (g->tran.data)) {
|
||||
eprintf ("Too large packet %d vs %d\n", (int)g->send_len, (int)sizeof (g->send_len));
|
||||
return false;
|
||||
}
|
||||
for (i = 0; i < g->send_len; i++) {
|
||||
ut8 c = g->tran.data[i];
|
||||
csum += c;
|
||||
|
Loading…
Reference in New Issue
Block a user