Merge pull request #424

be2764a miniupnpc: quick fix for buffer overflow (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2015-10-11 21:48:54 +02:00
commit b96b7c0177
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,10 @@
void IGDstartelt(void * d, const char * name, int l)
{
struct IGDdatas * datas = (struct IGDdatas *)d;
if (l >= MINIUPNPC_URL_MAXSIZE) {
printf("Attempt to exploit miniupnpc buffer overflow\n");
l = MINIUPNPC_URL_MAXSIZE - 1;
}
memcpy( datas->cureltname, name, l);
datas->cureltname[l] = '\0';
datas->level++;