Handling error in PCSCF decoding 93/53993/1
authorSuresh Kumar N <suresh.n@samsung.com>
Thu, 10 Dec 2015 15:01:16 +0000 (20:31 +0530)
committerSuresh Kumar N <suresh.n@samsung.com>
Thu, 10 Dec 2015 15:01:16 +0000 (20:31 +0530)
Change-Id: I314afb90991b42657c51527e1cc90c88bfd6d97e

src/core_object/co_sim.c

index 50287c3..f53cd0a 100644 (file)
@@ -2811,9 +2811,15 @@ gboolean tcore_sim_decode_isim_pcscf(struct tel_sim_pcscf *p_out, unsigned char
 
        /* P-CSCF Address length */
        len = p_in[1];
+       if (len <= 0) {
+               err("invalid address length : len : %d", len);
+               return FALSE;
+       }
 
-       if (in_length < len + 2)
+       if (in_length < len + 2) {
                err("invalid length. in_length[%d] < TLV_len[%d] + 2", in_length, len);
+               return FALSE;
+       }
 
        /* P-CSCF Address type */
        if (p_in[2] == 0x00)