forked from osmocom/wireshark
Fix some "bad file" messages.
The number being compared against is the amount of data *remaining* in the comment information, not the *size* of the comment information. And it's unsigned, so format it with %u. Change-Id: I5f02302ad4acbc3b27655ff5518e6e56d464020d Reviewed-on: https://code.wireshark.org/review/28280 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
7f3d7199fb
commit
1e84591f4f
|
@ -702,7 +702,7 @@ wtap_open_return_val netmon_open(wtap *wth, int *err, gchar **err_info)
|
|||
}
|
||||
if (pletoh32(&comment_header.titleLength) > comment_table_size) {
|
||||
*err = WTAP_ERR_BAD_FILE;
|
||||
*err_info = g_strdup_printf("netmon: comment title size is %u, which is larger than the entire comment section (%d)",
|
||||
*err_info = g_strdup_printf("netmon: comment title size is %u, which is larger than the amount remaining in the comment section (%u)",
|
||||
pletoh32(&comment_header.titleLength), comment_table_size);
|
||||
g_hash_table_destroy(comment_table);
|
||||
return WTAP_OPEN_ERROR;
|
||||
|
@ -755,7 +755,7 @@ wtap_open_return_val netmon_open(wtap *wth, int *err, gchar **err_info)
|
|||
/* Make sure comment size is sane */
|
||||
if (comment_rec->descLength > comment_table_size) {
|
||||
*err = WTAP_ERR_BAD_FILE;
|
||||
*err_info = g_strdup_printf("netmon: comment description size is %u, which is larger than the entire comment section (%d)",
|
||||
*err_info = g_strdup_printf("netmon: comment description size is %u, which is larger than the amount remaining in the comment section (%u)",
|
||||
comment_rec->descLength, comment_table_size);
|
||||
g_hash_table_destroy(comment_table);
|
||||
return WTAP_OPEN_ERROR;
|
||||
|
|
Loading…
Reference in New Issue