On 07/10/2019 20.37, Martin Hundebøll wrote:
Why not do something like:

         g_at_mux_ref(mux);

                 for (i = 1; i <= MAX_CHANNELS && !mux->shutdown; i++) {
                         int offset = i / 8;
                         int bit = i % 8;

                         if (!(mux->newdata[offset] & (1 << bit)))
                                 continue;

                         dispatch_sources(mux->dlcs[i-1], G_IO_IN);
                 }

         g_at_mux_unref(mux);


I'm afraid this isn't enough, as I still get use-after-free when using gatmux in the quectel plugin (see attached log).

I've added g_at_mux_{ref,unref}() calls to the read and write watchers too. This fixes it. Patch coming up.

But, it breaks calling g_at_mux_unref() without calling g_at_mux_shutdown() first, since the unref now doesn't decrement the refcount to zero.

// Martin
_______________________________________________
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org

Reply via email to