Sanitize input in id_h - prevent integer overflows
This commit is contained in:
parent
350e2d2d15
commit
bbe60c0f35
1 changed files with 1 additions and 1 deletions
|
@ -283,7 +283,7 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat
|
|||
bool id_h(connection_t *c, const char *request) {
|
||||
char name[MAX_STRING_SIZE];
|
||||
|
||||
if(sscanf(request, "%*d " MAX_STRING " %d.%d", name, &c->protocol_major, &c->protocol_minor) < 2) {
|
||||
if(sscanf(request, "%*d " MAX_STRING " %2d.%3d", name, &c->protocol_major, &c->protocol_minor) < 2) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Got bad %s from %s (%s)", "ID", c->name,
|
||||
c->hostname);
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue