Bug in "subscriber ... name", if name contains spaces
-----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 _______________________________________________________________________ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMH1ulAXzltVKV/2wRAlV9AJ9NoQUnUs9HL0d/UnExoBzfjbgZzwCeMJPy NFRpXWHlpRKMTYftSrbqehI= =b5i3 -----END PGP SIGNATURE-----
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) -- - Harald Welte <laforge@gnumonks.org> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
participants (2)
-
Harald Welte -
Luca Bertoncello