Hi, attached is a patch that cleans up gsm_7bit_decode_hdr() a little and removes the need for calloc/free. This way, this function can be used on systems that do not have the required allocation routines (e.g. a layer1 firmware).
This is a bit selfish, as I personally need it :)
Cheers Nico
On Mon, Sep 17, 2012 at 06:30:38PM +0200, Nico Golde wrote:
This is a bit selfish, as I personally need it :)
the best patches. :)
Cheers Nico
- uint8_t *rtext = calloc(septet_l, sizeof(uint8_t));
- uint8_t tmp;
- uint8_t data[160];
- uint8_t ext_septet;
could you please add a check for septet_l >= sizeof(data) and log an error? I don't remember right now if we use this routine for USSD or not.
Hi, * Holger Hans Peter Freyther holger@freyther.de [2012-09-18 13:25]:
On Mon, Sep 17, 2012 at 06:30:38PM +0200, Nico Golde wrote:
- uint8_t *rtext = calloc(septet_l, sizeof(uint8_t));
- uint8_t tmp;
- uint8_t data[160];
- uint8_t ext_septet;
could you please add a check for septet_l >= sizeof(data) and log an error? I don't remember right now if we use this routine for USSD or not.
New patch attached.
Cheers Nico
Hi, * Sylvain Munaut 246tnt@gmail.com [2012-09-18 13:52]:
New patch attached.
I'm not a big fan of adding this limitation ... and linking to the log system as well.
I agree.
AFAICT there is nothing that prevents rewriting the algorithm itself to just not need a buffer at all.
Attached is a rewritten patch that removes the buffer completely based on your input on IRC.
Kind regards Nico
Hi Nico,
On Tue, Sep 18, 2012 at 02:31:14PM +0200, Nico Golde wrote:
Attached is a rewritten patch that removes the buffer completely based on your input on IRC.
thanks, merged.
Hi, * Harald Welte laforge@gnumonks.org [2012-09-20 16:08]:
On Tue, Sep 18, 2012 at 02:31:14PM +0200, Nico Golde wrote:
Attached is a rewritten patch that removes the buffer completely based on your input on IRC.
thanks, merged.
Thanks! Sylvaint just pointed out another issue with the patch, the check for the last char being an extension char has to take precedence over the check for the extension char.
Cheers Nico
Hi Nico,
On Thu, Sep 20, 2012 at 05:00:36PM +0200, Nico Golde wrote:
Thanks! Sylvaint just pointed out another issue with the patch, the check for the last char being an extension char has to take precedence over the check for the extension char.
merged in my local tree, will push when I'm next near some internet connection...
baseband-devel@lists.osmocom.org