Skip to content

Commit

Permalink
modules/b2b_entities: fix crash when restoring b2b entities from dbtext
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiusas committed Mar 5, 2016
1 parent 7e0175b commit 11a805b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/b2b_entities/b2be_db.c
Expand Up @@ -494,15 +494,15 @@ int b2b_entities_restore(void)
dlg.id = local_index;
dlg.state = row_vals[13].val.int_val;
dlg.ruri.s = (char*)row_vals[4].val.string_val;
dlg.ruri.len = strlen(dlg.ruri.s);
dlg.ruri.len = dlg.ruri.s?strlen(dlg.ruri.s):0;
dlg.from_uri.s = (char*)row_vals[5].val.string_val;
dlg.from_uri.len = strlen(dlg.from_uri.s);
dlg.from_dname.s = (char*)row_vals[6].val.string_val;
dlg.from_dname.len = strlen(dlg.from_dname.s);
dlg.to_uri.s = (char*)row_vals[7].val.string_val;
dlg.to_uri.len = strlen(dlg.to_uri.s);
dlg.to_dname.s = (char*)row_vals[8].val.string_val;
dlg.to_dname.len = strlen(dlg.to_dname.s);
dlg.to_dname.len = dlg.to_dname.s?strlen(dlg.to_dname.s):0;
dlg.tag[0].s = (char*)row_vals[1].val.string_val;
dlg.tag[0].len = dlg.tag[0].s?strlen(dlg.tag[0].s):0;
dlg.cseq[0] = row_vals[14].val.int_val;
Expand Down

4 comments on commit 11a805b

@bogdan-iancu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ovidiusas , thanks for the fix. Question: is it possible to get a NULL ruri while loading from DB ?

Also, maybe this fix should be backported to 1.11 and 2.1, right ?

@ovidiusas
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a NULL while using dbtext. Probably for MySQL an empty string is returned.
The issue with dbtext is that empty strings are not supported. Instead NULL is returned.
The b2b modules with dbtext on 1.11 and 2.1 will not work, unless the dbtext schema is manually altered.
We could backport, but the fix it's specific to dbtext, which is broken on old releases for this modules.

@bogdan-iancu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ovidiusas , my comment was not db backend related, but how comes that in a SIP request the RURI is NULL or empty string....or maybe I'm missing something about the data contained by that dlg.ruri field.

@ovidiusas
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need to investigate that. The field is empty if dbtext is used.
I will investigate more and get back with more info.

Please sign in to comment.