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-09 23:37

You missed some brakets there in that if, the comparison is broken and will never work since you're checking if something has different values at the same time, pointer variables don't work that way ( char *derp, *hurr; would be correct), and there's probably some other nonsense in there that I can't know of without looking at icecast sources, which I can't be bothered to do.

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