Fix a buffer overflow found by the Visual C++ analyzer.

svn path=/trunk/; revision=35953
This commit is contained in:
Gerald Combs 2011-02-16 00:42:06 +00:00
parent 4099dfa603
commit f3bbbce5e3
1 changed files with 7 additions and 0 deletions

View File

@ -392,6 +392,13 @@ static gboolean dct3trace_seek_read (wtap *wth, gint64 seek_off,
return FALSE;
}
if( buf_len > MAX_PACKET_LEN)
{
*err = WTAP_ERR_BAD_RECORD;
*err_info = g_strdup_printf("dct3trace: record length %d too long", buf_len);
return FALSE;
}
memcpy( pd, buf, buf_len );
return TRUE;
}