-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, List!
I found a bug in OpenBSC. If I try to change the name of a subscriber using Telnet (command "subscriber ... name") I got an error, if the name contains spaces (for example: first and lastname).
I found the problem and I wrote a patches. I send it as attachment.
Greetings - -- _______________________________________________________________________ Luca Bertoncello Entwicklung Mail: bertoncello@netzing.de
NETZING Solutions AG Tel.: 0351/41381 - 0 Kesselsdorfer Str. 216, 01169 Dresden Fax: 0351/41381 - 12 HRB 18926 / Ust.ID DE211326547 Mail: netzing.ag@netzing.de _______________________________________________________________________
Dear Luca,
thanks for your patch.
I found a bug in OpenBSC. If I try to change the name of a subscriber using Telnet (command "subscriber ... name") I got an error, if the name contains spaces (for example: first and lastname).
I found the problem and I wrote a patches.
I have appllied your patch but found some problem (whcih I already fixed):
struct gsm_network *gsmnet = gsmnet_from_vty(vty); struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]);
- const char *name = argv[2];
- char *name;
- name = argv_concat(argv, argc, 2);
we never check if name is NULL here
if (!subscr) { vty_out(vty, "%% No subscriber found for %s %s%s", @@ -410,6 +412,7 @@ DEFUN(ena_subscr_name, }
strncpy(subscr->name, name, sizeof(subscr->name));
- talloc_free(name);
we only free it in case subscr != NULL. If subscr == NULL, the function has already returned before we get to this free, causing a memory leak.
I have now re-ordered the function slightly to fix this problem (9d4cca7)