Fix Coverty 1392 ('name' might be NULL): don't write out the interface name when we're trying to write out the interface description.

svn path=/trunk/; revision=41779
This commit is contained in:
Jeff Morriss 2012-03-26 21:57:57 +00:00
parent b800903ca2
commit 2256fabd86
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ libpcap_write_interface_description_block(FILE *fp,
option.type = IDB_DESCRIPTION;
option.value_length = (guint16)strlen(descr);
WRITE_DATA(fp, &option, sizeof(struct option), *bytes_written, err);
WRITE_DATA(fp, name, strlen(descr), *bytes_written, err);
WRITE_DATA(fp, descr, strlen(descr), *bytes_written, err);
if (strlen(descr) % 4) {
WRITE_DATA(fp, &padding, 4 - strlen(descr) % 4 , *bytes_written, err);
}