Changeset 61e7e02 for protocols/twitter


Ignore:
Timestamp:
2015-06-08T03:25:18Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
1201fcb, e4f08bf
Parents:
56c8a4f
Message:

twitter: fix leak of the letter "s" in twitter_url_len_diff

Yeah, just the letter s from "https", and a null byte.

Really critical stuff.

You'd have to post a million tweets to even notice this at all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r56c8a4f r61e7e02  
    469469        g_regex_match(regex, msg, 0, &match_info);
    470470        while (g_match_info_matches(match_info)) {
    471                 gchar *url = g_match_info_fetch(match_info, 2);
     471                gchar *s, *url;
     472
     473                url = g_match_info_fetch(match_info, 2);
    472474                url_len_diff += target_len - g_utf8_strlen(url, -1);
     475
    473476                /* Add another character for https://t.co/... URLs */
    474                 if (g_match_info_fetch(match_info, 3) != NULL) {
     477                if ((s = g_match_info_fetch(match_info, 3))) {
    475478                        url_len_diff += 1;
     479                        g_free(s);
    476480                }
    477481                g_free(url);
Note: See TracChangeset for help on using the changeset viewer.