[xiph-commits] r18720 - icecast/branches/ph3/libshout/src
ph3-der-loewe at svn.xiph.org
ph3-der-loewe at svn.xiph.org
Fri Nov 23 14:29:49 PST 2012
Author: ph3-der-loewe
Date: 2012-11-23 14:29:49 -0800 (Fri, 23 Nov 2012)
New Revision: 18720
Modified:
icecast/branches/ph3/libshout/src/shout.c
Log:
check validity of keys
Modified: icecast/branches/ph3/libshout/src/shout.c
===================================================================
--- icecast/branches/ph3/libshout/src/shout.c 2012-11-22 22:48:56 UTC (rev 18719)
+++ icecast/branches/ph3/libshout/src/shout.c 2012-11-23 22:29:49 UTC (rev 18720)
@@ -656,12 +656,18 @@
int shout_set_meta(shout_t *self, const char *name, const char *value)
{
+ size_t i;
+
if (!self)
return self->error = SHOUTERR_INSANE;
if (self->state != SHOUT_STATE_UNCONNECTED)
return self->error = SHOUTERR_CONNECTED;
+ for (i = 0; name[i]; i++)
+ if ((name[i] < 'a' || name[i] > 'z') && (name[i] < '0' || name[i] > '9'))
+ return self->error = SHOUTERR_INSANE;
+
return self->error = _shout_util_dict_set(self->meta, name, value);
}
More information about the commits
mailing list