[#7708] Bug in libsnmp-ruby1.8 — Hadmut Danisch <hadmut@...>

Hi,

8 messages 2006/04/11
[#7709] Re: Bug in libsnmp-ruby1.8 — Eric Hodel <drbrain@...7.net> 2006/04/11

On Apr 11, 2006, at 6:23 AM, Hadmut Danisch wrote:

[#7770] Re: possible defect in array.c — "Brown, Warren" <warrenbrown@...>

> rb_range_beg_len (in range.c) does set beg and len.

13 messages 2006/04/26
[#7771] Re: possible defect in array.c — "Pat Eyler" <rubypate@...> 2006/04/26

On 4/26/06, Brown, Warren <warrenbrown@aquire.com> wrote:

Re: possible defect in ext/openssl/ossl_ans1.c (with fix)

From: ville.mattila@...
Date: 2006-04-27 04:28:59 UTC
List: ruby-core #7786
I think this is false positive.

>From: "Pat Eyler" <rubypate@gmail.com>
>Date: 27.04.2006 07:02:49
>Subject: possible defect in ext/openssl/ossl_ans1.c (with fix)
>
>768                  VALUE klass = *ossl_asn1_info[tag].klass;
>
>Event var_decl: Declared variable "flag" without initializer
>Also see events: [uninit_use_in_call]
>
>769                  long flag;
>
>At conditional (1): "rb_obj_is_kind_of == 0" taking false path
>
>770                  if(!rb_obj_is_kind_of(value, rb_cArray)){
      switch(tag){
>773                        value = decode_bool(start, hlen+len);
>774                        break;
>775                    case V_ASN1_INTEGER:
>776                        value = decode_int(start, hlen+len);
>777                        break;
>778                    case V_ASN1_BIT_STRING:
>779                        value = decode_bstr(start, hlen+len, &flag);
      Here the flag is initialized


>780                        break;
>781                    case V_ASN1_NULL:
>782                        value = decode_null(start, hlen+len);
>783                        break;
>784                    case V_ASN1_ENUMERATED:
>785                        value = decode_enum(start, hlen+len);
>786                        break;
>787                    case V_ASN1_OBJECT:
>788                        value = decode_obj(start, hlen+len);
>789                        break;
>790                    case V_ASN1_UTCTIME:           /* FALLTHROUGH */
>791                    case V_ASN1_GENERALIZEDTIME:
>792                        value = decode_time(start, hlen+len);
>793                        break;
>794                    default:
>795                        /* use original value */
>796                        break;
>797                    }
>798                  }
>799                  asn1data = rb_funcall(klass, rb_intern("new"), 1,
>value);
>
>At conditional (2): "tag == 3" taking true path
>
>800                  if(tag == V_ASN1_BIT_STRING){
      and here we have same tag as in line 779.

>
>Event uninit_use_in_call: Using uninitialized value "flag" in call to
>function "rb_int2inum" [model]
>Also see events: [var_decl]
>
>801                    rb_iv_set(asn1data, "@unused_bits",
>LONG2NUM(flag));
>802                  }
>803              }
>
>
could you use unified diff e.g "diff -pu", it is easier to read.




In This Thread

Prev Next