Showing error 1676

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: net/irda/iriap.c
Line in file: 473
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 07:54:05 UTC


Source:

 443        int n;
 444
 445        IRDA_ASSERT(self != NULL, return;);
 446        IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
 447        IRDA_ASSERT(skb != NULL, return;);
 448
 449        /* Initialize variables */
 450        fp = skb->data;
 451        n = 2;
 452
 453        /* Get length, MSB first */
 454        len = get_unaligned_be16(fp + n);
 455        n += 2;
 456
 457        IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len);
 458
 459        /* Get object ID, MSB first */
 460        obj_id = get_unaligned_be16(fp + n);
 461        n += 2;
 462
 463        type = fp[n++];
 464        IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type);
 465
 466        switch (type) {
 467        case IAS_INTEGER:
 468                memcpy(&tmp_cpu32, fp+n, 4); n += 4;
 469                be32_to_cpus(&tmp_cpu32);
 470                value = irias_new_integer_value(tmp_cpu32);
 471
 472                /*  Legal values restricted to 0x01-0x6f, page 15 irttp */
 473                IRDA_DEBUG(4, "%s(), lsap=%d\n", __func__, value->t.integer);
 474                break;
 475        case IAS_STRING:
 476                charset = fp[n++];
 477
 478                switch (charset) {
 479                case CS_ASCII:
 480                        break;
 481/*                case CS_ISO_8859_1: */
 482/*                case CS_ISO_8859_2: */
 483/*                case CS_ISO_8859_3: */
Show full sources