imc: better check for buffer size limit
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 27 Jul 2017 09:34:35 +0000 (11:34 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 27 Jul 2017 09:34:35 +0000 (11:34 +0200)
src/modules/imc/imc.c
src/modules/imc/imc_cmd.c

index 8876b24..2ae31c9 100644 (file)
@@ -304,11 +304,6 @@ int add_from_db(void)
                imc_dbf.free_result(imc_db, r_res);
                r_res = NULL;
        }
-       if(m_res)
-       {
-               imc_dbf.free_result(imc_db, m_res);
-               m_res = NULL;
-       }
 
        return 0;
 
index 781bf57..1514e2c 100644 (file)
@@ -467,8 +467,7 @@ int imc_handle_invite(struct sip_msg* msg, imc_cmd_t *cmd,
        }
        
        body.len = 13 + member->uri.len - 4/* sip: */ + 28;     
-       if(body.len>=IMC_BUF_SIZE || member->uri.len>=IMC_BUF_SIZE
-                       || room->uri.len>=IMC_BUF_SIZE)
+       if(body.len>=IMC_BUF_SIZE-1)
        {
                LM_ERR("buffer size overflow\n");
                goto error;