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-10 17:12

The check for &# that you've written will never pass, and you need to encase the shit you've written in brackets.  It will not do what you want it to.

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