[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

spu for vpb-driver 4.2.38-1?



Hi,

There's a bug in libvpb0 that can cause asterisk to crash when no
config file is present and no cards are detected.  In that case the
card count is uninitialised, and random hilarity may ensue.

It's been suggested that this warrants an upload to spu to fix, and
I'm inclined to agree.  A fix has been uploaded for Sid in 4.2.44-1,
and I can apply the following minimal patch to 4.2.38-1 to also fix
it for Lenny users:

diff --git a/src/libvpb/utilfuncs.cpp b/src/libvpb/utilfuncs.cpp
index 5209815..2f2f872 100644
--- a/src/libvpb/utilfuncs.cpp
+++ b/src/libvpb/utilfuncs.cpp
@@ -120,6 +120,8 @@ llc_list *vpb_read_confll(CONF_INFO *cp)
        float rec_gain     = 0.0;
        int encoding=-1;
 
+       cp->cardcount       = 0;
+
        llc_list *list      = NULL;
        llc_cat  *cat       = NULL;
        llc_var  *var       = NULL;
@@ -129,8 +131,7 @@ llc_list *vpb_read_confll(CONF_INFO *cp)
 
        mprintf("vpb_read_confll: loaded [%s]\n",file);
 
-       cp->cardcount = 0;
-       list          = conf_find_list(list_root,"general");
+       list = conf_find_list(list_root,"general");
        if(list != NULL)
        { //{{{
                cat = conf_find_cat(list->cats,"general");


It simply moves the cardcount initialisation to above the point where
that function may return if no config file is present to be read, so
there is little (no) possibility of adverse side effects from making
that change.  It just ensures cardcount is always initialised before
anything else looks at its value.

If you're happy for this update to occur, let me know and I'll prepare
a package and push it out.

Cheers,
Ron



Reply to: