Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fixing the icecast unicode bug

Name: Anonymous 2010-07-09 23:17

Icecast has an issue in how it parses http queries containing unicode. The query is escaped twice, so instead of having appear as it's converted to あ.

I am very new to sepples, but I need this patched within 4 days from now, and seeing how the icecast forums won't let me register I have decided to try fixing it myself.

const char *httpp_get_query_param(http_parser_t *parser, const char *name)
{
    http_var_t var;
    http_var_t *found;
    void *fp;

    fp = &found;
    var.name = (char *)name;
    var.value = NULL;

    if (avl_get_by_key(parser->queryvars, (void *)&var, fp) == 0)
        //return found->value;
       
        // ED PRETENDING HE KNOWS SEPPLES
        int durr = 0;
        char* derp, hurr;
        derp = found->value;
        for (int a = 0; derp[a]!=0; a++) {
            hurr[durr] = derp[a];
            if (derp[a+0]=='&' &&
                derp[a+1]=='a' &&
                derp[a+1]=='m' &&
                derp[a+1]=='p' &&
                derp[a+1]==';' &&
                derp[a+1]=='#') {
                a += 4;
            }
            durr++;
        }
        return hurr;
        // END OF PATCH
    else
        return NULL;
}


My question to you, dear /prog/riders, is whether this is completely pantsu-on-head retarded bullshit or if it'll actually work. I can't compile anything right now, so I'll let you be my interpreter.

Name: Anonymous 2010-07-13 21:19

BREAKING NEWS!

Turns out the error isn't in the parser at all. It's somewhere else in the code. The plot thickens.

After fumbling about for a while, it turns out that it all comes down to commenting out the following two lines in format_mp3.c:

    //value = util_conv_string (in_value, charset, plugin->charset);
    //if (value == NULL)
        value = strdup (in_value);


The only thing remaining is to add a charset=UTF8 header to websites, but anyone should be able to figure that out.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List