Pjproject - Bug report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I would like to report bug. I have not found any other option than sending this email. Bug is here on line 966:
https://github.com/pjsip/pjproject/blob/master/pjsip/src/pjsua-lib/pjsua_acc.c

It happens when you modify account to the lowest priority out of all accounts. For example 3 accounts have priority 1 and you modify first account to priority 0.

/* Resort accounts priority */
    for (i=0; i<pjsua_var.acc_cnt; ++i) {
        if (pjsua_var.acc_ids[i] == acc_id)
        break;
    }
    pj_assert(i < pjsua_var.acc_cnt);
    pj_array_erase(pjsua_var.acc_ids, sizeof(acc_id),  pjsua_var.acc_cnt, i);
    for (i=0; i<pjsua_var.acc_cnt; ++i) { // SHOULD BE: for (i=0; i<pjsua_var.acc_cnt-1; ++i)  ...because one item was removed from acc_ids[]
        if (pjsua_var.acc[pjsua_var.acc_ids[i]].cfg.priority <   acc->cfg.priority) // if others accounts priority > than current accout priority, this never pass
        {
        break;
        }
    }
// variable "i" will be = pjsua_var.acc_cnt which is out of array
    pj_array_insert(pjsua_var.acc_ids, sizeof(acc_id),    pjsua_var.acc_cnt, i, &acc_id); // acc_id is inserted to array index acc_cnt which is out of bounds

Thanks for fixing bug,
Jan
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux