~ubuntu-branches/debian/experimental/ettercap/experimental

« back to all changes in this revision

Viewing changes to src/dissectors/ec_ldap.c

  • Committer: Package Import Robot
  • Author(s): Barak A. Pearlmutter
  • Date: 2013-03-27 11:55:24 UTC
  • mfrom: (25.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130327115524-ahjhvuh03ejcfuui
Tags: 1:0.7.6-2~exp1
Experimental release with IPv6 support

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
   DECLARE_DISP_PTR_END(ptr, end);
50
50
   u_int16 type, user_len, pass_len;
51
51
   char tmp[MAX_ASCII_ADDR_LEN];
52
 
   
53
 
   /* unused variable */
54
 
   (void)end;
55
52
 
56
 
   /* Skip ACK packets */
57
 
   if (PACKET->DATA.len == 0)
 
53
   /* We need at least 15 bytes of data to be interested*/
 
54
   if (PACKET->DATA.len < 15)
58
55
      return NULL;
59
56
    
60
57
   /* Only packets coming from the server */
69
66
 
70
67
   /* Quite self-explaining :) */
71
68
   user_len = (u_int16)ptr[11];
 
69
 
 
70
   if ((ptr + user_len + 12) > end)
 
71
      return NULL;
 
72
 
72
73
   pass_len = (u_int16)ptr[13 + user_len];
73
74
 
 
75
   if ((ptr + user_len + pass_len + 14) > end)
 
76
      return NULL;
 
77
 
74
78
   if (user_len == 0) {
75
79
      PACKET->DISSECTOR.user = strdup("[Anonymous Bind]");
76
80
      PACKET->DISSECTOR.pass = strdup("");