Skip to content

Commit

Permalink
BER: Fix segmentation fault when configuring new OIDs
Browse files Browse the repository at this point in the history
 Program terminated with signal 11, Segmentation fault.
 #0  0x00007f573e5bdecf in uat_fld_chk_oid (u1=0x2eb1830, strptr=0x7f573c8431e4 "", len=0, u2=0x0, u3=0x0, err=0x7ffee1668748) at uat.c:494
 494	    if(strptr[len-1] == '.') {
 (gdb)
 (gdb) bt
 #0  0x00007f573e5bdecf in uat_fld_chk_oid (u1=0x2eb1830, strptr=0x7f573c8431e4 "", len=0, u2=0x0, u3=0x0, err=0x7ffee1668748) at uat.c:494
 #1  0x0000000000485dfc in uat_dlg_cb (win=0x3844290, user_data=0x3632bc0) at uat_gui.c:364
 #2  0x00007f573b2f19a7 in _g_closure_invoke_va (closure=0x3367130, return_value=0x0, instance=0x3844290, args=0x7ffee1668a78, n_params=0,

Change-Id: Ic61480f8c1f2cd833c58de0b2acc24dcb831578f
Reviewed-on: https://code.wireshark.org/review/16800
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
(cherry picked from commit bf123ef)
Reviewed-on: https://code.wireshark.org/review/16814
(cherry picked from commit 1c9e52e)
Reviewed-on: https://code.wireshark.org/review/16815
  • Loading branch information
velichkov authored and stigbjorlykke committed Jul 31, 2016
1 parent 8ca110f commit 84f31a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions epan/uat.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ gboolean uat_fld_chk_oid(void* u1 _U_, const char* strptr, guint len, const void
return FALSE;
}

if (len == 0) {
*err = g_strdup("Empty OID");
return FALSE;
}

for(i = 0; i < len; i++)
if(!(g_ascii_isdigit(strptr[i]) || strptr[i] == '.')) {
*err = g_strdup("Only digits [0-9] and \".\" allowed in an OID");
Expand Down

0 comments on commit 84f31a4

Please sign in to comment.