[polypaudio-commits] r865 - /trunk/src/polypcore/protocol-esound.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun May 14 09:18:01 PDT 2006


Author: lennart
Date: Sun May 14 18:18:00 2006
New Revision: 865

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=865&root=polypaudio&view=rev
Log:
add utf8 validity checking to esound protocol

Modified:
    trunk/src/polypcore/protocol-esound.c

Modified: trunk/src/polypcore/protocol-esound.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/protocol-esound.c?rev=865&root=polypaudio&r1=864&r2=865&view=diff
==============================================================================
--- trunk/src/polypcore/protocol-esound.c (original)
+++ trunk/src/polypcore/protocol-esound.c Sun May 14 18:18:00 2006
@@ -341,6 +341,8 @@
     strncpy(name, data, sizeof(name));
     name[sizeof(name)-1] = 0;
 
+    CHECK_VALIDITY(pa_utf8_valid(name), "Invalid UTF8 in stream name");
+    
     pa_client_set_name(c->client, name);
 
     assert(!c->sink_input && !c->input_memblockq);
@@ -422,6 +424,8 @@
     
     strncpy(name, data, sizeof(name));
     name[sizeof(name)-1] = 0;
+
+    CHECK_VALIDITY(pa_utf8_valid(name), "Invalid UTF8 in stream name.");
 
     pa_client_set_name(c->client, name);
 
@@ -689,6 +693,8 @@
     strcpy(name, SCACHE_PREFIX);
     strncpy(name+sizeof(SCACHE_PREFIX)-1, data, ESD_NAME_MAX);
     name[sizeof(name)-1] = 0;
+
+    CHECK_VALIDITY(pa_utf8_valid(name), "Invalid UTF8 in sample name.");
     
     assert(!c->scache.memchunk.memblock);
     c->scache.memchunk.memblock = pa_memblock_new(sc_length, c->protocol->core->memblock_stat);
@@ -718,6 +724,8 @@
     strcpy(name, SCACHE_PREFIX);
     strncpy(name+sizeof(SCACHE_PREFIX)-1, data, ESD_NAME_MAX);
     name[sizeof(name)-1] = 0;
+
+    CHECK_VALIDITY(pa_utf8_valid(name), "Invalid UTF8 in sample name.");
 
     ok = -1;
     if ((idx = pa_scache_get_id_by_name(c->protocol->core, name)) != PA_IDXSET_INVALID)




More information about the pulseaudio-commits mailing list