On Mon, 2003-12-01 at 08:28, Melanie wrote:> > diff -b -B -r -u -P --exclude-from=ignore ../icecast/src/source.c > ./src/source.c > --- ../icecast/src/source.c Fri Nov 14 17:51:59 2003 > +++ ./src/source.c Mon Dec 1 09:14:34 2003 > @@ -139,7 +192,6 @@ > #endif > > free(source->mount); > - free(source->fallback_mount); > client_destroy(source->client); > avl_tree_free(source->pending_tree, _free_client); > avl_tree_free(source->client_tree, _free_client); > > > This is the patch and without it, anything using fallbacks will fail > miserably. It is the prerequisite for almost all other patches, because > this bug is a showstopper. Unless and until this patch is applied, all the > others are useless.Just to let you know, this isn't the actual fix. a simple config re-read can invalidate the pointer. karl. <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
True - in that case, another fix ist called for, but it's just as simple: diff -b -B -r -u -P --exclude-from=ignore ../icecast/src/source.c ./src/source.c--- ../icecast/src/source.c Mon Dec 1 14:49:52 2003 +++ ./src/source.c Mon Dec 1 14:50:56 2003 @@ -72,7 +72,7 @@ src->yp_public = 0; if(mountinfo != NULL) { - src->fallback_mount = mountinfo->fallback_mount; + src->fallback_mount = (char *)strdup(mountinfo->fallback_mount); src->max_listeners = mountinfo->max_listeners; src->dumpfilename = mountinfo->dumpfile; } Melanie <p>On 2003.12.01 14:41 Karl Heyes wrote:> On Mon, 2003-12-01 at 08:28, Melanie wrote: > > > > > diff -b -B -r -u -P --exclude-from=ignore ../icecast/src/source.c > > ./src/source.c > > --- ../icecast/src/source.c Fri Nov 14 17:51:59 2003 > > +++ ./src/source.c Mon Dec 1 09:14:34 2003 > > @@ -139,7 +192,6 @@ > > #endif > > > > free(source->mount); > > - free(source->fallback_mount); > > client_destroy(source->client); > > avl_tree_free(source->pending_tree, _free_client); > > avl_tree_free(source->client_tree, _free_client); > > > > > > This is the patch and without it, anything using fallbacks will fail > > miserably. It is the prerequisite for almost all other patches, because > > this bug is a showstopper. Unless and until this patch is applied, all > the > > others are useless. > > Just to let you know, this isn't the actual fix. a simple config re-read > can invalidate the pointer. > > karl. > > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > icecast project homepage: http://www.icecast.org/ > To unsubscribe from this list, send a message to > 'icecast-dev-request@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. >--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Mon, 2003-12-01 at 13:52, Melanie wrote:> True - in that case, another fix ist called for, but it's just as simple: > > diff -b -B -r -u -P --exclude-from=ignore ../icecast/src/source.c > ./src/source.c--- ../icecast/src/source.c Mon Dec 1 14:49:52 2003 > +++ ./src/source.c Mon Dec 1 14:50:56 2003 > @@ -72,7 +72,7 @@ > src->yp_public = 0; > > if(mountinfo != NULL) { > - src->fallback_mount = mountinfo->fallback_mount; > + src->fallback_mount = (char *)strdup(mountinfo->fallback_mount); > src->max_listeners = mountinfo->max_listeners; > src->dumpfilename = mountinfo->dumpfile; > }2 things... - you missed dumpfile which also has the same issue :) - the config lock really needs to be taken. You don't want the mountinfo details to disappear which it could do if the config file was switched over.>From looking at it we could just re-take the config lock within thisfunction, the users of this function don't have the lock at the time this is invoked. karl. <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.