[OpenSIPS-Devel] [ opensips-Bugs-2710489 ] BLOB handling in db_berkeley

SourceForge.net noreply at sourceforge.net
Sun Sep 27 13:29:43 CEST 2009


Bugs item #2710489, was opened at 2009-03-25 00:13
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2710489&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: BLOB handling in db_berkeley

Initial Comment:
There is an error in function bdb_val2str (file bdb_val.c):
Should be:
        case DB_BLOB:
                l = VAL_BLOB(_v).len;
                if (*_len < l) 
                {
                        LM_ERR("Destination buffer too short for blob\n");
                        return -7;
                } 
                else 
                {
                        strncpy(_s,VAL_BLOB(_v).s,l);
                        LM_DBG("Converting BLOB [%s]\n", _s);
                        *_len = l;
                        return 0;
                }
                break;

Also, if we consider DB_STR, DB_STRING and DB_BLOB the same type, then  bdb_is_neq_type (file bdb_res.c) need small correction:

case DB_STRING:
                        if(_t0==DB_STR || _t0==DB_BLOB)
                                return 0;
                case DB_STR:
                        if(_t0==DB_STRING || _t0==DB_BLOB)
                                return 0;
                case DB_BLOB:
                        if(_t0==DB_STR || _t0==DB_STRING)
                                return 0;


----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-09-27 14:29

Message:
The fix is available on SVN trunk - to be tested and backported to 1.5
also.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2710489&group_id=232389



More information about the Devel mailing list