Re: Making disconnection more robust

2017-08-11 Thread Tim Small
A couple more questions... What should the code do if a return to AT command mode fails? Currently the code just continues to try and use a port which is still in data mode - issuing AT commands on it... In my case I'd like to be able to (as a last resort) power-cycle the modem if it remains unr

Re: Making disconnection more robust

2017-08-11 Thread Aleksander Morgado
On Fri, Aug 11, 2017 at 1:05 PM, Tim Small wrote: > A couple more questions... > > What should the code do if a return to AT command mode fails? Currently > the code just continues to try and use a port which is still in data > mode - issuing AT commands on it... > Yeah, not ideal :) > In my c

Re: Making disconnection more robust

2017-08-11 Thread Tim Small
On 11/08/17 14:09, Aleksander Morgado wrote: > I'd suggest we try to move > that modem to "Failed" state instead, as we really lost the control > port; and let the applications using MM do whatever they need to do > with a failed modem, including external power cycle or whatever. Hi, Yes that mak

Re: [PATCH] broadband-modem-mbim: explicitly remove notification handler on unref

2017-08-11 Thread Dan Williams
On Fri, 2017-08-11 at 17:04 +0200, Aleksander Morgado wrote: > When we remove the last object reference, make sure the notification > handler is also removed, or we may end up using an already freed > object. > > https://retrace.fedoraproject.org/faf/reports/1815001/ Good catch; any time we conne

Re: [PATCH] broadband-modem-mbim: explicitly remove notification handler on unref

2017-08-11 Thread Aleksander Morgado
>> When we remove the last object reference, make sure the notification >> handler is also removed, or we may end up using an already freed >> object. >> >> https://retrace.fedoraproject.org/faf/reports/1815001/ > > Good catch; any time we connect a signal somewhere in an object, we > should probab

Re: Making disconnection more robust

2017-08-11 Thread Aleksander Morgado
On Fri, Aug 11, 2017 at 3:58 PM, Tim Small wrote: > On 11/08/17 14:09, Aleksander Morgado wrote: >> I'd suggest we try to move >> that modem to "Failed" state instead, as we really lost the control >> port; and let the applications using MM do whatever they need to do >> with a failed modem, inclu

[PATCH] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Ben Chan
The while loop in mm_charset_get_encoded_len() iterates through each valid UTF-8 encoded character in the given NULL-terminated UTF-8 string. It uses g_utf8_find_next_char() to find the position of the next character. In case, g_utf8_find_next_char() returns NULL, it tries to find the end (i.e. the

Re: [PATCH] libmm-glib, sms-properties: fix potential NULL dereference

2017-08-11 Thread Ben Chan
On Fri, Aug 11, 2017 at 11:32 AM, Ben Chan wrote: > This patch fixes a potential NULL referenece issue in > mm_sms_properties_get_data() where it accesses `self->priv->data->data' > when `self->priv->data' could be potentially NULL. > --- > libmm-glib/mm-sms-properties.c | 5 - > 1 file chan

[PATCH v2] libmm-glib,sms-properties: fix potential NULL dereference

2017-08-11 Thread Ben Chan
This patch fixes a potential NULL referenece issue in mm_sms_properties_get_data() where it accesses `self->priv->data->data' when `self->priv->data' could be potentially NULL. --- libmm-glib/mm-sms-properties.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmm-glib/m

[PATCH] libmm-glib,cdma: fix potential NULL dereference

2017-08-11 Thread Ben Chan
This patch fixes a potential NULL referenece issue in mm_cdma_manual_activation_properties_get_prl() where it accesses `self->priv->prl->data' when `self->priv->prl' could be potentially NULL. --- libmm-glib/mm-cdma-manual-activation-properties.c | 7 --- 1 file changed, 4 insertions(+), 3 del

Re: [PATCH] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Dan Williams
On Fri, 2017-08-11 at 13:27 -0700, Ben Chan wrote: > The while loop in mm_charset_get_encoded_len() iterates through each > valid UTF-8 encoded character in the given NULL-terminated UTF-8 > string. > It uses g_utf8_find_next_char() to find the position of the next > character. In case, g_utf8_find

[PATCH v2] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Ben Chan
The while loop in mm_charset_get_encoded_len() iterates through each valid UTF-8 encoded character in the given NULL-terminated UTF-8 string. It uses g_utf8_find_next_char() to find the position of the next character. In case, g_utf8_find_next_char() returns NULL, it tries to find the end (i.e. the

Re: [PATCH] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Ben Chan
On Fri, Aug 11, 2017 at 2:54 PM, Dan Williams wrote: > On Fri, 2017-08-11 at 13:27 -0700, Ben Chan wrote: > > The while loop in mm_charset_get_encoded_len() iterates through each > > valid UTF-8 encoded character in the given NULL-terminated UTF-8 > > string. > > It uses g_utf8_find_next_char() t

Re: [PATCH] libmm-glib,cdma: fix potential NULL dereference

2017-08-11 Thread Dan Williams
On Fri, 2017-08-11 at 14:19 -0700, Ben Chan wrote: > This patch fixes a potential NULL referenece issue in > mm_cdma_manual_activation_properties_get_prl() where it accesses > `self->priv->prl->data' when `self->priv->prl' could be potentially > NULL. Thanks, pushed to git master and mm-1-6. Dan

Re: [PATCH] plugin: fix forbidden_product_strings check in apply_post_probing_filters

2017-08-11 Thread Dan Williams
On Fri, 2017-08-11 at 11:23 -0700, Ben Chan wrote: > This patch fixes a bug in apply_post_probing_filters() where it > iterates > through `self->priv->forbidden_product_strings' but incorrectly > accesses > `self->priv->product_strings[i]' inside the loop. > `self->priv->forbidden_product_strings[i

Re: [PATCH v2] libmm-glib,sms-properties: fix potential NULL dereference

2017-08-11 Thread Dan Williams
On Fri, 2017-08-11 at 14:16 -0700, Ben Chan wrote: > This patch fixes a potential NULL referenece issue in > mm_sms_properties_get_data() where it accesses `self->priv->data- > >data' > when `self->priv->data' could be potentially NULL. Thanks, pushed to git master and mm-1-6. Dan > --- >  libmm

Re: [PATCH] broadband-modem-mbim: explicitly remove notification handler on unref

2017-08-11 Thread Aleksander Morgado
On Fri, Aug 11, 2017 at 5:04 PM, Aleksander Morgado wrote: > When we remove the last object reference, make sure the notification > handler is also removed, or we may end up using an already freed > object. > > https://retrace.fedoraproject.org/faf/reports/1815001/ Pushed to git master, and backp