Remove -Wno-sign-compare and backport fixes from default.
--- a/configure.ac Wed Nov 12 19:15:24 2014 -0500
+++ b/configure.ac Thu Nov 13 00:56:55 2014 -0500
@@ -1254,7 +1254,7 @@
"-Wdeclaration-after-statement" \
"-Werror-implicit-function-declaration" \
- "-Wextra -Wno-sign-compare -Wno-unused-parameter" \
+ "-Wextra -Wno-unused-parameter" \ "-Werror=format-security" \
--- a/finch/gntrequest.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/gntrequest.c Thu Nov 13 00:56:55 2014 -0500
@@ -268,7 +268,7 @@
GntWidget *window, *box, *button, *focus = NULL;
window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_ACTION);
@@ -287,7 +287,7 @@
g_object_set_data(G_OBJECT(button), "activate-id", GINT_TO_POINTER(i));
g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(request_action_cb), window);
- if (i == default_value)
+ if (default_value >= 0 && i == (gsize)default_value) --- a/finch/libgnt/gntcolors.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gntcolors.c Thu Nov 13 00:56:55 2014 -0500
@@ -299,7 +299,7 @@
return (hascolors ? COLOR_PAIR(pair) :
((pair == GNT_COLOR_NORMAL || pair == GNT_COLOR_HIGHLIGHT_D ||
- pair == GNT_COLOR_TITLE_D || pair == GNT_COLOR_DISABLED) ? 0 : A_STANDOUT));
+ pair == GNT_COLOR_TITLE_D || pair == GNT_COLOR_DISABLED) ? 0 : (int)A_STANDOUT)); int gnt_color_add_pair(int fg, int bg)
--- a/finch/libgnt/gntentry.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gntentry.c Thu Nov 13 00:56:55 2014 -0500
@@ -184,7 +184,7 @@
show_suggest_dropdown(GntEntry *entry)
@@ -815,7 +815,7 @@
for (str = text; *str; str = next)
next = g_utf8_find_next_char(str, NULL);
@@ -834,7 +834,7 @@
if (entry->max && g_utf8_pointer_to_offset(entry->start, entry->end) >= entry->max)
- if (entry->end + len - entry->start >= entry->buffer)
+ if ((gsize)(entry->end + len - entry->start) >= entry->buffer) /* This will cause the buffer to grow */
char *tmp = g_strdup(entry->start);
@@ -1184,8 +1184,11 @@
g_return_if_fail(entry->history != NULL); /* Need to set_history_length first */
- if (g_list_length(entry->history) >= entry->histlength)
+ if (entry->histlength >= 0 && + g_list_length(entry->history) >= (gsize)entry->histlength) entry->history = g_list_first(entry->history);
g_free(entry->history->data);
--- a/finch/libgnt/gntmenu.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gntmenu.c Thu Nov 13 00:56:55 2014 -0500
@@ -309,7 +309,7 @@
menu->selected = g_list_length(menu->list) - 1;
} else if (strcmp(text, GNT_KEY_RIGHT) == 0) {
- if (menu->selected >= g_list_length(menu->list))
+ if ((guint)menu->selected >= g_list_length(menu->list)) } else if (strcmp(text, GNT_KEY_ENTER) == 0 ||
strcmp(text, GNT_KEY_DOWN) == 0) {
--- a/finch/libgnt/gntstyle.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gntstyle.c Thu Nov 13 00:56:55 2014 -0500
@@ -185,7 +185,7 @@
for (i = 1; i < MAX_WORKSPACES; ++i) {
--- a/finch/libgnt/gnttextview.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gnttextview.c Thu Nov 13 00:56:55 2014 -0500
@@ -513,7 +513,7 @@
GntTextFormatFlags flags, const char *tagname)
GntWidget *widget = GNT_WIDGET(view);
GList *list = view->list;
--- a/finch/libgnt/gntwm.c Wed Nov 12 19:15:24 2014 -0500
+++ b/finch/libgnt/gntwm.c Thu Nov 13 00:56:55 2014 -0500
@@ -443,7 +443,7 @@
wid = g_list_last(wm->cws->list)->data;
pos = g_list_length(wm->cws->list) - 1;
- } else if (pos >= g_list_length(wm->cws->list)) {
+ } else if ((guint)pos >= g_list_length(wm->cws->list)) { wid = wm->cws->list->data;
--- a/libpurple/account.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/account.c Thu Nov 13 00:56:55 2014 -0500
@@ -3038,7 +3038,8 @@
g_return_if_fail(account != NULL);
- g_return_if_fail(new_index <= g_list_length(accounts));
+ g_return_if_fail(new_index >= 0); + g_return_if_fail((guint)new_index <= g_list_length(accounts)); index = g_list_index(accounts, account);
--- a/libpurple/cipher.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/cipher.c Thu Nov 13 00:56:55 2014 -0500
@@ -444,8 +444,7 @@
/* 8k is a bit excessive, will tweak later. */
guchar digest[BUF_LEN * 4];
g_return_val_if_fail(context, FALSE);
g_return_val_if_fail(digest_s, FALSE);
--- a/libpurple/circbuffer.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/circbuffer.c Thu Nov 13 00:56:55 2014 -0500
@@ -42,8 +42,8 @@
static void grow_circ_buffer(PurpleCircBuffer *buf, gsize len) {
- int in_offset = 0, out_offset = 0;
+ gsize in_offset = 0, out_offset = 0; g_return_if_fail(buf != NULL);
@@ -70,10 +70,8 @@
* pointer, we need to shift the data */
if (in_offset < out_offset
|| (in_offset == out_offset && buf->bufused > 0)) {
- int shift_n = MIN(buf->buflen - start_buflen,
- memcpy(buf->buffer + start_buflen, buf->buffer,
+ gsize shift_n = MIN(buf->buflen - start_buflen, in_offset); + memcpy(buf->buffer + start_buflen, buf->buffer, shift_n); /* If we couldn't fit the wrapped read buffer
@@ -92,7 +90,7 @@
void purple_circ_buffer_append(PurpleCircBuffer *buf, gconstpointer src, gsize len) {
g_return_if_fail(buf != NULL);
@@ -105,8 +103,7 @@
* One copy from inptr to the end of the buffer, and the
* second copy from the start of the buffer to the end of src. */
if (buf->inptr >= buf->outptr)
- len_stored = MIN(len, buf->buflen
- - (buf->inptr - buf->buffer));
+ len_stored = MIN(len, buf->buflen - (buf->inptr - buf->buffer)); @@ -145,7 +142,7 @@
/* wrap to the start if we're at the end */
- if ((buf->outptr - buf->buffer) == buf->buflen)
+ if ((gsize)(buf->outptr - buf->buffer) == buf->buflen) buf->outptr = buf->buffer;
--- a/libpurple/dnsquery.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/dnsquery.c Thu Nov 13 00:56:55 2014 -0500
@@ -245,7 +245,7 @@
written = write(fd, buf, count);
- if (written != count) {
+ if (written < 0 || (gsize)written != count) { fprintf(stderr, "dns[%d]: Error writing data to "
"parent: %s\n", getpid(), strerror(errno));
@@ -554,7 +554,7 @@
purple_dnsquery_resolver_destroy(resolver);
- if (rc < sizeof(dns_params)) {
+ if ((gsize)rc < sizeof(dns_params)) { purple_debug_error("dns", "Tried to write %" G_GSSIZE_FORMAT
" bytes to child but only wrote %" G_GSSIZE_FORMAT "\n",
--- a/libpurple/dnssrv.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/dnssrv.c Thu Nov 13 00:56:55 2014 -0500
@@ -557,7 +557,7 @@
res->content = g_new0(gchar, len);
red = read(source, res->content, len);
+ if (red < 0 || (gsize)red != len) { purple_debug_error("dnssrv","unable to read txt "
"response: %s\n", g_strerror(errno));
--- a/libpurple/ft.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/ft.c Thu Nov 13 00:56:55 2014 -0500
@@ -98,7 +98,7 @@
{ PURPLE_XFER_STATUS_CANCEL_LOCAL, "cancelled locally" },
{ PURPLE_XFER_STATUS_CANCEL_REMOTE, "cancelled remotely" }
for (i = 0; i < G_N_ELEMENTS(type_names); ++i)
if (type_names[i].type == type)
@@ -1073,7 +1073,7 @@
- if (r == xfer->current_buffer_size)
+ if (r >= 0 && (gsize)r == xfer->current_buffer_size) * We managed to read the entire buffer. This means our this
* network is fast and our buffer is too small, so make it
@@ -1128,7 +1128,7 @@
wc = fwrite(buffer, 1, r, xfer->dest_fp);
purple_debug_error("filetransfer", "Unable to write whole buffer.\n");
purple_xfer_cancel_local(xfer);
@@ -1221,7 +1221,7 @@
that case buffer doesn't belong to us. */
- } else if (r == result) {
+ } else if (r >= 0 && (gsize)r == result) { * We managed to write the entire buffer. This means our
* network is fast and our buffer is too small, so make it
--- a/libpurple/media/backend-fs2.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/media/backend-fs2.c Thu Nov 13 00:56:55 2014 -0500
@@ -1950,7 +1950,7 @@
we need to do this to allow them to override when using non-standard
TURN modes, like Google f.ex. */
gboolean got_turn_from_prpl = FALSE;
session = get_session(self, sess_id);
--- a/libpurple/plugins/joinpart.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/joinpart.c Thu Nov 13 00:56:55 2014 -0500
@@ -80,7 +80,7 @@
--- a/libpurple/plugins/perl/perl-handlers.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/perl/perl-handlers.h Thu Nov 13 00:56:55 2014 -0500
@@ -25,7 +25,7 @@
} PurplePerlTimeoutHandler;
@@ -44,7 +44,7 @@
} PurplePerlPrefsHandler;
--- a/libpurple/plugins/signals-test.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/signals-test.c Thu Nov 13 00:56:55 2014 -0500
@@ -635,11 +635,11 @@
notify_emails_cb(char **subjects, char **froms, char **tos, char **urls, guint count) {
- purple_debug_misc("signals test", "notify emails: count=%d\n", count);
+ purple_debug_misc("signals test", "notify emails: count=%u\n", count); for(i=0; i<count && i<5; i++) {
if(subjects[i]==NULL || froms[i]==NULL || tos[i]==NULL || urls[i]==NULL) continue;
- purple_debug_misc("signals test", "notify emails[%d]: subject=%s, from=%s, to=%s, url=%s\n",
+ purple_debug_misc("signals test", "notify emails[%u]: subject=%s, from=%s, to=%s, url=%s\n", i, subjects[i], froms[i], tos[i], urls[i]);
--- a/libpurple/plugins/ssl/ssl-gnutls.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/ssl/ssl-gnutls.c Thu Nov 13 00:56:55 2014 -0500
@@ -287,7 +287,7 @@
const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
gnutls_session_t session=gnutls_data->session;
gnutls_certificate_get_peers(session, &cert_list_size);
--- a/libpurple/plugins/tcl/tcl_purple.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/tcl/tcl_purple.h Thu Nov 13 00:56:55 2014 -0500
@@ -47,7 +47,7 @@
--- a/libpurple/plugins/tcl/tcl_ref.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/plugins/tcl/tcl_ref.c Thu Nov 13 00:56:55 2014 -0500
@@ -117,12 +117,12 @@
static const char prefix[] = "purple-";
- static const int prefixlen = sizeof(prefix) - 1;
+ static const gsize prefixlen = sizeof(prefix) - 1; if (strlen(bytes) < prefixlen
|| strncmp(bytes, prefix, prefixlen)
|| (ptr = strchr(bytes, ':')) == NULL
- || (ptr - bytes) == prefixlen)
+ || (gsize)(ptr - bytes) == prefixlen) --- a/libpurple/protocols/bonjour/jabber.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/bonjour/jabber.c Thu Nov 13 00:56:55 2014 -0500
@@ -1169,7 +1169,7 @@
/* Send the end of the stream to the other end of the conversation */
if (bconv->sent_stream_start == FULLY_SENT) {
size_t len = strlen(STREAM_END);
- if (send(bconv->socket, STREAM_END, len, 0) != len) {
+ if (send(bconv->socket, STREAM_END, len, 0) != (gssize)len) { purple_debug_error("bonjour",
"bonjour_jabber_close_conversation: "
--- a/libpurple/protocols/irc/parse.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/irc/parse.c Thu Nov 13 00:56:55 2014 -0500
@@ -390,7 +390,7 @@
end = strpbrk(cur, "\002\003\007\017\026\037");
- decoded = g_string_append_len(decoded, cur, end ? end - cur : strlen(cur));
+ decoded = g_string_append_len(decoded, cur, (end ? (gssize)(end - cur) : (gssize)strlen(cur))); cur = end ? end : cur + strlen(cur);
--- a/libpurple/protocols/jabber/auth_scram.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/auth_scram.c Thu Nov 13 00:56:55 2014 -0500
@@ -34,7 +34,7 @@
static const JabberScramHash *mech_to_hash(const char *mech)
g_return_val_if_fail(mech != NULL && *mech != '\0', NULL);
--- a/libpurple/protocols/jabber/bosh.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/bosh.c Thu Nov 13 00:56:55 2014 -0500
@@ -1104,7 +1104,7 @@
- } else if (ret < len) {
+ } else if ((size_t)ret < len) { --- a/libpurple/protocols/jabber/jabber.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/jabber.c Thu Nov 13 00:56:55 2014 -0500
@@ -581,7 +581,7 @@
jabber_send_raw(js, buf, len);
- return (len < 0 ? strlen(buf) : len);
+ return (len < 0 ? (int)strlen(buf) : len); void jabber_send_signal_cb(PurpleConnection *pc, xmlnode **packet,
--- a/libpurple/protocols/jabber/jutil.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/jutil.c Thu Nov 13 00:56:55 2014 -0500
@@ -713,7 +713,7 @@
jabber_buddy_state_get_name(const JabberBuddyState state)
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (jabber_statuses[i].state == state)
return _(jabber_statuses[i].readable);
@@ -724,7 +724,7 @@
jabber_buddy_status_id_get_state(const char *id)
return JABBER_BUDDY_STATE_UNKNOWN;
@@ -737,7 +737,7 @@
JabberBuddyState jabber_buddy_show_get_state(const char *id)
g_return_val_if_fail(id != NULL, JABBER_BUDDY_STATE_UNKNOWN);
@@ -753,7 +753,7 @@
jabber_buddy_state_get_show(JabberBuddyState state)
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (state == jabber_statuses[i].state)
return jabber_statuses[i].show;
@@ -764,7 +764,7 @@
jabber_buddy_state_get_status_id(JabberBuddyState state)
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (state == jabber_statuses[i].state)
return jabber_statuses[i].status_id;
--- a/libpurple/protocols/jabber/oob.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/oob.c Thu Nov 13 00:56:55 2014 -0500
@@ -87,7 +87,8 @@
static void jabber_oob_xfer_request_send(gpointer data, gint source, PurpleInputCondition cond) {
JabberOOBXfer *jox = xfer->data;
- int len, total_len = strlen(jox->write_buffer);
+ size_t total_len = strlen(jox->write_buffer); len = write(xfer->fd, jox->write_buffer + jox->written_len,
total_len - jox->written_len);
--- a/libpurple/protocols/jabber/presence.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/presence.c Thu Nov 13 00:56:55 2014 -0500
@@ -63,7 +63,7 @@
static JabberPresenceType
str_to_presence_type(const char *type)
return JABBER_PRESENCE_AVAILABLE;
--- a/libpurple/protocols/jabber/si.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/jabber/si.c Thu Nov 13 00:56:55 2014 -0500
@@ -446,7 +446,7 @@
purple_xfer_cancel_remote(xfer);
- } else if(jsx->rxlen - 5 < jsx->rxqueue[4] + 2) {
+ } else if(jsx->rxlen - 5 < (size_t)jsx->rxqueue[4] + 2) { /* Upper-bound of 257 (jsx->rxlen = 5, jsx->rxqueue[4] = 0xFF) */
unsigned short to_read = jsx->rxqueue[4] + 2 - (jsx->rxlen - 5);
purple_debug_info("jabber", "reading %u bytes for DST.ADDR + port num (trying to read %hu now)\n",
@@ -467,7 +467,7 @@
/* Have we not read all of DST.ADDR and the following 2-byte port number? */
- if(jsx->rxlen - 5 < jsx->rxqueue[4] + 2)
+ if(jsx->rxlen - 5 < (size_t)jsx->rxqueue[4] + 2) purple_input_remove(xfer->watcher);
@@ -594,7 +594,7 @@
memcpy(jsx->rxqueue + jsx->rxlen, buffer, len);
- } else if(jsx->rxlen - 2 < jsx->rxqueue[1]) {
+ } else if(jsx->rxlen - 2 < (size_t)jsx->rxqueue[1]) { /* Has a maximum value of 255 (jsx->rxlen = 2, jsx->rxqueue[1] = 0xFF) */
unsigned short to_read = jsx->rxqueue[1] - (jsx->rxlen - 2);
purple_debug_info("jabber", "reading %u bytes for auth methods (trying to read %hu now)\n",
@@ -615,7 +615,7 @@
/* Have we not read all the auth. method bytes? */
- if(jsx->rxlen -2 < jsx->rxqueue[1])
+ if(jsx->rxlen -2 < (size_t)jsx->rxqueue[1]) purple_input_remove(xfer->watcher);
--- a/libpurple/protocols/msn/command.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/command.c Thu Nov 13 00:56:55 2014 -0500
@@ -57,7 +57,7 @@
for (c = 0; cmd->params[c] && cmd->params[c][0]; c++);
--- a/libpurple/protocols/msn/command.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/command.h Thu Nov 13 00:56:55 2014 -0500
@@ -41,7 +41,7 @@
--- a/libpurple/protocols/msn/directconn.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/directconn.c Thu Nov 13 00:56:55 2014 -0500
@@ -406,7 +406,7 @@
dc->msg_pos += bytes_sent;
- if (dc->msg_pos == p->length) {
+ if ((guint32)dc->msg_pos == p->length) { @@ -671,7 +671,7 @@
/* Wait for the whole packet to arrive */
- if (dc->in_pos < 4 + packet_length)
+ if ((guint32)dc->in_pos < 4 + packet_length) switch (msn_dc_process_packet(dc, packet_length)) {
@@ -685,7 +685,7 @@
- if (dc->in_pos > packet_length + 4) {
+ if ((guint32)dc->in_pos > packet_length + 4) { g_memmove(dc->in_buffer, dc->in_buffer + 4 + packet_length, dc->in_pos - packet_length - 4);
--- a/libpurple/protocols/msn/history.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/history.c Thu Nov 13 00:56:55 2014 -0500
@@ -68,7 +68,7 @@
msn_history_add(MsnHistory *history, MsnTransaction *trans)
g_return_if_fail(history != NULL);
g_return_if_fail(trans != NULL);
--- a/libpurple/protocols/msn/httpconn.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/httpconn.c Thu Nov 13 00:56:55 2014 -0500
@@ -126,7 +126,7 @@
if ((s = purple_strcasestr(header, "Content-Length: ")) != NULL)
s += strlen("Content-Length: ");
@@ -400,7 +400,7 @@
- if (res < 0 || res < data_len)
+ if (res < 0 || (size_t)res < data_len) --- a/libpurple/protocols/msn/msg.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/msg.c Thu Nov 13 00:56:55 2014 -0500
@@ -371,7 +371,7 @@
body = msn_message_get_bin_data(msg, &body_len);
- if (body != NULL && (end - n) > body_len)
+ if (body != NULL && (end - n) > (gssize)body_len) memcpy(n, body, body_len);
--- a/libpurple/protocols/msn/nexus.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/nexus.c Thu Nov 13 00:56:55 2014 -0500
@@ -56,7 +56,7 @@
msn_nexus_new(MsnSession *session)
nexus = g_new0(MsnNexus, 1);
nexus->session = session;
@@ -74,7 +74,7 @@
msn_nexus_destroy(MsnNexus *nexus)
for (i = 0; i < nexus->token_len; i++) {
g_hash_table_destroy(nexus->tokens[i].token);
g_free(nexus->tokens[i].secret);
@@ -269,7 +269,7 @@
id = atol(id_str + 7) - 1; /* 'Compact#' or 'PPToken#' */
- if (id >= nexus->token_len)
+ if (id < 0 || (gsize)id >= nexus->token_len) return FALSE; /* Where did this come from? */
@@ -381,7 +381,7 @@
@@ -405,7 +405,7 @@
domains = g_string_new(NULL);
for (i = 0; i < nexus->token_len; i++) {
g_string_append_printf(domains, MSN_SSO_RST_TEMPLATE,
ticket_domains[i][SSO_VALID_TICKET_DOMAIN],
ticket_domains[i][SSO_VALID_TICKET_POLICY] != NULL ?
ticket_domains[i][SSO_VALID_TICKET_POLICY] :
--- a/libpurple/protocols/msn/nexus.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/nexus.h Thu Nov 13 00:56:55 2014 -0500
@@ -206,7 +206,7 @@
void msn_nexus_connect(MsnNexus *nexus);
--- a/libpurple/protocols/msn/notification.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/notification.c Thu Nov 13 00:56:55 2014 -0500
@@ -240,7 +240,7 @@
gboolean protocol_supported = FALSE;
session = cmdproc->session;
--- a/libpurple/protocols/msn/p2p.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/p2p.c Thu Nov 13 00:56:55 2014 -0500
@@ -133,7 +133,9 @@
header->opcode = msn_pop8(wire);
header->message_len = msn_pop16be(wire);
header->base_id = msn_pop32be(wire);
- if (header->header_len + header->message_len + P2P_PACKET_FOOTER_SIZE > max_len) {
+ if ((gsize)header->header_len + header->message_len + + P2P_PACKET_FOOTER_SIZE > max_len) /* Invalid header and data length */
@@ -208,12 +210,12 @@
char *data_header_wire = NULL;
if (header->header_tlv != NULL)
- header_wire = msn_tlvlist_write(header->header_tlv, (size_t *)&header->header_len);
+ header_wire = msn_tlvlist_write(header->header_tlv, &header->header_len); if (header->data_tlv != NULL)
- data_header_wire = msn_tlvlist_write(header->data_tlv, (size_t *)&header->data_header_len);
+ data_header_wire = msn_tlvlist_write(header->data_tlv, &header->data_header_len); header->data_header_len = 0;
--- a/libpurple/protocols/msn/servconn.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/servconn.c Thu Nov 13 00:56:55 2014 -0500
@@ -389,7 +389,7 @@
if (ret < 0 && errno == EAGAIN)
- if (ret >= 0 && ret < len) {
+ if (ret >= 0 && (size_t)ret < len) { if (servconn->tx_handler == 0)
servconn->tx_handler = purple_input_add(
servconn->fd, PURPLE_INPUT_WRITE,
@@ -462,7 +462,8 @@
if (servconn->payload_len)
- if (servconn->payload_len > servconn->rx_len)
+ if (servconn->rx_len < 0 + || servconn->payload_len > (gsize)servconn->rx_len) /* The payload is still not complete. */
--- a/libpurple/protocols/msn/slplink.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/slplink.c Thu Nov 13 00:56:55 2014 -0500
@@ -289,7 +289,7 @@
@@ -546,8 +546,8 @@
|| (offset + part->size) > slpmsg->size
|| msn_p2p_info_get_offset(slpmsg->p2p_info) != offset) {
purple_debug_error("msn",
- "Oversized slpmsg - msgsize=%lld offset=%" G_GUINT64_FORMAT " len=%" G_GSIZE_FORMAT "\n",
- slpmsg->size, offset, part->size);
+ "Oversized slpmsg - msgsize=%" G_GSIZE_FORMAT " offset=%" G_GUINT64_FORMAT " len=%" G_GSIZE_FORMAT "\n", + (gsize)slpmsg->size, offset, (gsize)part->size); memcpy(slpmsg->buffer + offset, part->buffer, part->size);
--- a/libpurple/protocols/msn/slpmsg.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/slpmsg.h Thu Nov 13 00:56:55 2014 -0500
@@ -57,7 +57,7 @@
* This is the size of buffer, unless this is an outgoing file transfer,
* in which case this is the size of the file.
GList *parts; /**< A list with the SlpMsgParts */
--- a/libpurple/protocols/msn/slpmsg_part.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/slpmsg_part.c Thu Nov 13 00:56:55 2014 -0500
@@ -172,7 +172,7 @@
--- a/libpurple/protocols/msn/tlv.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/tlv.c Thu Nov 13 00:56:55 2014 -0500
@@ -326,7 +326,7 @@
-msn_tlvlist_write(GSList *list, size_t *out_len)
+msn_tlvlist_write(GSList *list, guint8 *out_len) @@ -339,7 +339,7 @@
for (; list; list = g_slist_next(list)) {
msn_tlv_t *tlv = (msn_tlv_t *)list->data;
- if (G_UNLIKELY(tlv->length + 2 > bytes_left)) {
+ if (G_UNLIKELY((gsize)tlv->length + 2 > bytes_left)) { buf = g_realloc(buf, total_len + 256);
--- a/libpurple/protocols/msn/tlv.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/tlv.h Thu Nov 13 00:56:55 2014 -0500
@@ -52,7 +52,7 @@
int msn_tlvlist_count(GSList *list);
size_t msn_tlvlist_size(GSList *list);
gboolean msn_tlvlist_equal(GSList *one, GSList *two);
-char *msn_tlvlist_write(GSList *list, size_t *out_len);
+char *msn_tlvlist_write(GSList *list, guint8 *out_len); void msn_tlvlist_free(GSList *list);
int msn_tlvlist_add_raw(GSList **list, const guint8 type, const guint8 length, const char *value);
--- a/libpurple/protocols/msn/transaction.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/transaction.c Thu Nov 13 00:56:55 2014 -0500
@@ -158,7 +158,7 @@
msn_transaction_set_payload(MsnTransaction *trans,
- const char *payload, int payload_len)
+ const char *payload, gsize payload_len) g_return_if_fail(trans != NULL);
g_return_if_fail(payload != NULL);
--- a/libpurple/protocols/msn/transaction.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/msn/transaction.h Thu Nov 13 00:56:55 2014 -0500
@@ -75,7 +75,7 @@
void msn_transaction_queue_cmd(MsnTransaction *trans, MsnCommand *cmd);
void msn_transaction_unqueue_cmd(MsnTransaction *trans, MsnCmdProc *cmdproc);
void msn_transaction_set_payload(MsnTransaction *trans,
- const char *payload, int payload_len);
+ const char *payload, gsize payload_len); void msn_transaction_set_data(MsnTransaction *trans, void *data);
void msn_transaction_set_data_free(MsnTransaction *trans, GDestroyNotify fn);
void msn_transaction_set_saveable(MsnTransaction *trans, gboolean saveable);
--- a/libpurple/protocols/myspace/myspace.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/myspace/myspace.c Thu Nov 13 00:56:55 2014 -0500
@@ -1776,10 +1776,10 @@
lid = msim_msg_get_integer(msg, "lid");
/* Unsolicited messages */
- if (cmd == (MSIM_CMD_BIT_REPLY | MSIM_CMD_GET)) {
- if (dsn == MG_SERVER_INFO_DSN && lid == MG_SERVER_INFO_LID) {
+ if (cmd == (guint)(MSIM_CMD_BIT_REPLY | MSIM_CMD_GET)) { + if (dsn == (guint)MG_SERVER_INFO_DSN && lid == (guint)MG_SERVER_INFO_LID) { return msim_process_server_info(session, msg);
- } else if (dsn == MG_WEB_CHALLENGE_DSN && lid == MG_WEB_CHALLENGE_LID) {
+ } else if (dsn == (guint)MG_WEB_CHALLENGE_DSN && lid == (guint)MG_WEB_CHALLENGE_LID) { return msim_web_challenge(session, msg);
@@ -2989,7 +2989,7 @@
purple_debug_info("msim", "msim_send_raw: writing <%s>\n", msg);
- return msim_send_really_raw(session->gc, msg, len) == len;
+ return msim_send_really_raw(session->gc, msg, len) == (int)len; @@ -3563,7 +3563,7 @@
l = purple_accounts_get_all();
if (purple_account_is_connected(l->data) &&
- (uid == 0 || purple_account_get_int(l->data, "uid", 0) == uid)) {
+ (uid == 0 || purple_account_get_int(l->data, "uid", 0) == (int)uid)) { --- a/libpurple/protocols/myspace/user.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/myspace/user.c Thu Nov 13 00:56:55 2014 -0500
@@ -423,8 +423,8 @@
- if (msim_msg_get_integer(msg, "dsn") == MG_OWN_IM_INFO_DSN &&
- msim_msg_get_integer(msg, "lid") == MG_OWN_IM_INFO_LID)
+ if (msim_msg_get_integer(msg, "dsn") == (guint)MG_OWN_IM_INFO_DSN && + msim_msg_get_integer(msg, "lid") == (guint)MG_OWN_IM_INFO_LID) * Some of this info will be available on the buddy list if the
@@ -452,8 +452,8 @@
session->show_only_to_list ? 1 : 0,
session->privacy_mode & 1),
- } else if (msim_msg_get_integer(msg, "dsn") == MG_OWN_MYSPACE_INFO_DSN &&
- msim_msg_get_integer(msg, "lid") == MG_OWN_MYSPACE_INFO_LID) {
+ } else if (msim_msg_get_integer(msg, "dsn") == (guint)MG_OWN_MYSPACE_INFO_DSN && + msim_msg_get_integer(msg, "lid") == (guint)MG_OWN_MYSPACE_INFO_LID) { /* TODO: same as above, but for MySpace info. */
--- a/libpurple/protocols/oscar/bstream.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/bstream.c Thu Nov 13 00:56:55 2014 -0500
@@ -49,7 +49,7 @@
-int byte_stream_bytes_left(ByteStream *bs)
+size_t byte_stream_bytes_left(ByteStream *bs) return bs->len - bs->offset;
@@ -79,7 +79,7 @@
int byte_stream_advance(ByteStream *bs, int n)
g_return_val_if_fail(byte_stream_curpos(bs) + n >= 0, 0);
- g_return_val_if_fail(n <= byte_stream_bytes_left(bs), 0);
+ g_return_val_if_fail((gsize)n <= byte_stream_bytes_left(bs), 0); --- a/libpurple/protocols/oscar/family_feedbag.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/family_feedbag.c Thu Nov 13 00:56:55 2014 -0500
@@ -80,7 +80,7 @@
for (i = 0; i < G_N_ELEMENTS(type_strings); i++) {
if (type_strings[i].type == type) {
return type_strings[i].string;
--- a/libpurple/protocols/oscar/oscar.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/oscar.c Thu Nov 13 00:56:55 2014 -0500
@@ -949,17 +949,15 @@
buf = g_strdup_printf("GET " AIMHASHDATA "?offset=%ld&len=%ld&modname=%s HTTP/1.0\n\n",
pos->offset, pos->len, pos->modname ? pos->modname : "");
result = send(pos->fd, buf, strlen(buf), 0);
- if (result != strlen(buf)) {
- purple_debug_error("oscar", "Error writing %" G_GSIZE_FORMAT
- " bytes to fetch AIM hash data: %s\n",
- strlen(buf), g_strerror(errno));
- purple_debug_error("oscar", "Tried to write %"
- G_GSIZE_FORMAT " bytes to fetch AIM hash data but "
- "instead wrote %" G_GSSIZE_FORMAT " bytes\n",
+ purple_debug_error("oscar", "Error writing %" G_GSIZE_FORMAT + " bytes to fetch AIM hash data: %s\n", + strlen(buf), g_strerror(errno)); + else if ((gsize)result != strlen(buf)) + purple_debug_error("oscar", "Tried to write %" + G_GSIZE_FORMAT " bytes to fetch AIM hash data but " + "instead wrote %" G_GSSIZE_FORMAT " bytes\n", pos->inpa = purple_input_add(pos->fd, PURPLE_INPUT_READ, damn_you, pos);
@@ -1068,7 +1066,7 @@
PurpleConnection *gc = od->gc;
PurpleAccount *account = purple_connection_get_account(gc);
struct aim_authresp_info *info;
--- a/libpurple/protocols/oscar/oscar.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/oscar.h Thu Nov 13 00:56:55 2014 -0500
@@ -595,8 +595,8 @@
PurpleConversation *conv;
@@ -1212,7 +1212,7 @@
int byte_stream_new(ByteStream *bs, size_t len);
int byte_stream_init(ByteStream *bs, guint8 *data, size_t len);
void byte_stream_destroy(ByteStream *bs);
-int byte_stream_bytes_left(ByteStream *bs);
+size_t byte_stream_bytes_left(ByteStream *bs); int byte_stream_curpos(ByteStream *bs);
int byte_stream_setpos(ByteStream *bs, size_t off);
void byte_stream_rewind(ByteStream *bs);
--- a/libpurple/protocols/oscar/tlv.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/tlv.c Thu Nov 13 00:56:55 2014 -0500
@@ -658,7 +658,7 @@
int aim_tlvlist_write(ByteStream *bs, GSList **list)
--- a/libpurple/protocols/oscar/util.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/oscar/util.c Thu Nov 13 00:56:55 2014 -0500
@@ -62,7 +62,7 @@
-static const int msgerrreasonlen = G_N_ELEMENTS(msgerrreason);
+static const gsize msgerrreasonlen = G_N_ELEMENTS(msgerrreason); const char *oscar_get_msgerr_reason(size_t reason)
--- a/libpurple/protocols/silc/buddy.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/silc/buddy.c Thu Nov 13 00:56:55 2014 -0500
@@ -750,7 +750,7 @@
char filename[512], filename2[512], *fingerprint = NULL, *tmp;
/* The user did not trust the public key. */
--- a/libpurple/protocols/silc/chat.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/silc/chat.c Thu Nov 13 00:56:55 2014 -0500
@@ -680,14 +680,14 @@
silcpurple_chat_ulimit_cb(SilcPurpleChatInput s, const char *limit)
SilcChannelEntry channel;
channel = silc_client_get_channel(s->sg->client, s->sg->conn,
+ ulimit = strtoul(limit, NULL, 10); if (!limit || !(*limit) || *limit == '0') {
if (limit && ulimit == channel->user_limit) {
@@ -1120,7 +1120,7 @@
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) @@ -1131,7 +1131,7 @@
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { @@ -1165,7 +1165,7 @@
SilcChannelEntry channel;
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) @@ -1185,7 +1185,7 @@
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { @@ -1202,7 +1202,7 @@
/* Leave from private groups on this channel as well */
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->chid == id) {
+ if (((SilcPurplePrvgrp)l->data)->chid == (gulong)id) { silc_client_del_channel_private_key(client, conn,
@@ -1266,7 +1266,7 @@
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) @@ -1286,7 +1286,7 @@
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { @@ -1357,7 +1357,7 @@
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) @@ -1368,7 +1368,7 @@
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { --- a/libpurple/protocols/silc/ops.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/silc/ops.c Thu Nov 13 00:56:55 2014 -0500
@@ -455,7 +455,6 @@
memset(buf, 0, sizeof(buf));
@@ -851,6 +850,7 @@
pk = silc_pkcs_public_key_encode(public_key, &pk_len);
--- a/libpurple/protocols/silc/pk.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/silc/pk.c Thu Nov 13 00:56:55 2014 -0500
@@ -122,7 +122,7 @@
SilcVerifyPublicKey completion, void *context)
PurpleConnection *gc = client->application;
char file[256], filename[256], filename2[256], *ipf, *hostf = NULL;
char *fingerprint, *babbleprint;
--- a/libpurple/protocols/yahoo/libymsg.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/libymsg.c Thu Nov 13 00:56:55 2014 -0500
@@ -2542,11 +2542,13 @@
static void yahoo_p2p_write_pkt(gint source, struct yahoo_packet *pkt)
/*build the raw packet and send it to the host*/
pkt_len = yahoo_packet_build(pkt, 0, 0, 0, &raw_packet);
- if(write(source, raw_packet, pkt_len) != pkt_len)
+ written = write(source, raw_packet, pkt_len); + if (written < 0 || (gsize)written != pkt_len) purple_debug_warning("yahoo","p2p: couldn't write to the source\n");
--- a/libpurple/protocols/yahoo/libymsg.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/libymsg.h Thu Nov 13 00:56:55 2014 -0500
@@ -129,7 +129,7 @@
YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
YAHOO_STATUS_TYPING = 0x16,
- YAHOO_STATUS_DISCONNECTED = 0xffffffff /* in ymsg 15. doesnt mean the normal sense of 'disconnected' */
+ YAHOO_STATUS_DISCONNECTED = -1 /* 0xffffffff; in ymsg 15. doesnt mean the normal sense of 'disconnected' */ --- a/libpurple/protocols/yahoo/util.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/util.c Thu Nov 13 00:56:55 2014 -0500
@@ -546,7 +546,7 @@
GString *cdata = g_string_new(NULL);
gboolean no_more_gt_brackets = FALSE;
gchar *xmlstr1, *xmlstr2, *esc;
@@ -803,7 +803,7 @@
gboolean no_more_gt_brackets = FALSE;
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Thu Nov 13 00:56:55 2014 -0500
@@ -412,7 +412,7 @@
static guint calculate_length(const gchar *l, size_t len)
for (i = 0; i < len; i++) {
if (!g_ascii_isdigit(l[i]))
--- a/libpurple/protocols/yahoo/yahoo_packet.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/yahoo_packet.c Thu Nov 13 00:56:55 2014 -0500
@@ -139,7 +139,7 @@
@@ -370,7 +370,7 @@
+ if ((gsize)ret < len) { yd->txhandler = purple_input_add(yd->fd, PURPLE_INPUT_WRITE,
yahoo_packet_send_can_write, yd);
--- a/libpurple/protocols/yahoo/yahoo_packet.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/yahoo_packet.h Thu Nov 13 00:56:55 2014 -0500
@@ -121,7 +121,7 @@
--- a/libpurple/protocols/yahoo/yahoo_picture.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/yahoo_picture.c Thu Nov 13 00:56:55 2014 -0500
@@ -420,7 +420,7 @@
- if (d->pos >= d->str->len) {
+ if ((size_t)d->pos >= d->str->len) { purple_debug_misc("yahoo", "Finished uploading buddy icon.\n");
purple_input_remove(d->watcher);
/* Clean out the sent buffer and reuse it to read the result */
--- a/libpurple/protocols/yahoo/ycht.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/yahoo/ycht.c Thu Nov 13 00:56:55 2014 -0500
@@ -490,7 +490,7 @@
--- a/libpurple/protocols/zephyr/ZReadAscii.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/zephyr/ZReadAscii.c Thu Nov 13 00:56:55 2014 -0500
@@ -10,7 +10,7 @@
-#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?temp:((temp-='A'-'9'-1),(temp<16)?temp:-1))
+#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?(int)temp:((temp-='A'-'9'-1),(temp<16)?(int)temp:-1)) Code_t ZReadAscii(ptr, len, field, num)
--- a/libpurple/protocols/zephyr/ZVariables.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/zephyr/ZVariables.c Thu Nov 13 00:56:55 2014 -0500
@@ -206,7 +206,7 @@
#define max(a,b) ((a > b) ? (a) : (b))
- if (g_ascii_strncasecmp(bfr, var, max(strlen(var), cp - bfr)))
+ if (g_ascii_strncasecmp(bfr, var, max(strlen(var), (gsize)(cp - bfr)))) return(0); /* var is not the var in
--- a/libpurple/protocols/zephyr/Zinternal.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/zephyr/Zinternal.c Thu Nov 13 00:56:55 2014 -0500
@@ -206,7 +206,7 @@
if (ZCompareUID(uid, &qptr->uid) && qptr->kind == kind)
- if (qptr->timep && (qptr->timep+Z_NOTICETIMELIMIT < tv.tv_sec))
+ if (qptr->timep && ((time_t)qptr->timep+Z_NOTICETIMELIMIT < tv.tv_sec)) @@ -654,7 +654,7 @@
Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
--- a/libpurple/protocols/zephyr/internal.h Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/zephyr/internal.h Thu Nov 13 00:56:55 2014 -0500
@@ -105,7 +105,7 @@
Code_t Z_AddNoticeToEntry __P((struct _Z_InputQ*, ZNotice_t*, int));
Code_t Z_FormatAuthHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
Code_t Z_FormatHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
-Code_t Z_FormatRawHeader __P((ZNotice_t *, char*, int,
+Code_t Z_FormatRawHeader __P((ZNotice_t *, char*, gsize, int*, char **, char **));
Code_t Z_ReadEnqueue __P((void));
Code_t Z_ReadWait __P((void));
--- a/libpurple/protocols/zephyr/zephyr.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/protocols/zephyr/zephyr.c Thu Nov 13 00:56:55 2014 -0500
@@ -2090,8 +2090,7 @@
static char* zephyr_tzc_escape_msg(const char *message)
+ gsize pos = 0, pos2 = 0; if (message && (strlen(message) > 0)) {
@@ -2122,8 +2121,7 @@
char* zephyr_tzc_deescape_str(const char *message)
+ gsize pos = 0, pos2 = 0; if (message && (strlen(message) > 0)) {
--- a/libpurple/proxy.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/proxy.c Thu Nov 13 00:56:55 2014 -0500
@@ -878,7 +878,7 @@
purple_proxy_connect_data_disconnect(connect_data, g_strerror(errno));
- if (ret < request_len) {
+ if ((gsize)ret < request_len) { connect_data->written_len += ret;
@@ -943,7 +943,7 @@
headers_len = (p - (char *)connect_data->read_buffer) + 4;
- } else if(len == max_read)
+ } else if((gsize)len == max_read) @@ -1465,7 +1465,7 @@
-s5_ensure_buffer_length(PurpleProxyConnectData *connect_data, int len)
+s5_ensure_buffer_length(PurpleProxyConnectData *connect_data, guint len) if(connect_data->read_len < len) {
if(connect_data->read_buf_len < len) {
--- a/libpurple/purple-client.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/purple-client.c Thu Nov 13 00:56:55 2014 -0500
@@ -15,7 +15,7 @@
static GList *garray_int_to_glist(GArray *array)
for (i = 0; i < array->len; i++)
list = g_list_append(list, GINT_TO_POINTER(g_array_index(array,gint,i)));
@@ -27,7 +27,7 @@
static GSList *garray_int_to_gslist(GArray *array)
for (i = 0; i < array->len; i++)
list = g_slist_append(list, GINT_TO_POINTER(g_array_index(array,gint,i)));
--- a/libpurple/stun.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/stun.c Thu Nov 13 00:56:55 2014 -0500
@@ -138,7 +138,7 @@
if (sendto(sc->fd, sc->packet, sc->packetsize, 0,
(struct sockaddr *)&(sc->addr), sizeof(struct sockaddr_in)) !=
+ (gssize)sc->packetsize) purple_debug_warning("stun", "sendto failed\n");
@@ -171,7 +171,7 @@
struct stun_conn *sc = data;
struct stun_attrib *attrib;
@@ -188,13 +188,13 @@
- if (len < sizeof(struct stun_header)) {
+ if ((gsize)len < sizeof(struct stun_header)) { purple_debug_warning("stun", "got invalid response\n");
hdr = (struct stun_header*) buffer;
- if (len != (ntohs(hdr->len) + sizeof(struct stun_header))) {
+ if ((gsize)len != (ntohs(hdr->len) + sizeof(struct stun_header))) { purple_debug_warning("stun", "got incomplete response\n");
@@ -323,7 +323,7 @@
if(sendto(sc->fd, &hdr_data, sizeof(struct stun_header), 0,
(struct sockaddr *)&(sc->addr),
- sizeof(struct sockaddr_in)) < sizeof(struct stun_header)) {
+ sizeof(struct sockaddr_in)) < (gssize)sizeof(struct stun_header)) { nattype.status = PURPLE_STUN_STATUS_UNKNOWN;
nattype.lookup_time = time(NULL);
--- a/libpurple/upnp.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/upnp.c Thu Nov 13 00:56:55 2014 -0500
@@ -372,7 +372,7 @@
const char *path, *start = strstr(baseURL, "://");
start = start ? start + 3 : baseURL;
path = strchr(start, '/');
- length = path ? path - baseURL : strlen(baseURL);
+ length = path ? (gsize)(path - baseURL) : strlen(baseURL); controlURL = g_strdup_printf("%.*s%s", (int)length, baseURL, tmp);
controlURL = g_strdup_printf("%s%s", baseURL, tmp);
@@ -611,10 +611,10 @@
totalSize = strlen(sendMessage);
- if(sendto(dd->fd, sendMessage, totalSize, 0,
- (struct sockaddr*) &(dd->server),
- sizeof(struct sockaddr_in)
+ gssize sent = sendto(dd->fd, sendMessage, totalSize, 0, + (struct sockaddr*) &(dd->server), + sizeof(struct sockaddr_in)); + if (sent >= 0 && (gsize)sent == totalSize) { --- a/libpurple/util.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/util.c Thu Nov 13 00:56:55 2014 -0500
@@ -129,7 +129,7 @@
purple_base16_encode(const guchar *data, gsize len)
g_return_val_if_fail(data != NULL, NULL);
@@ -146,7 +146,7 @@
purple_base16_decode(const char *str, gsize *ret_len)
- int len, i, accumulator = 0;
+ gsize len, i, accumulator = 0; g_return_val_if_fail(str != NULL, NULL);
@@ -193,7 +193,7 @@
purple_base16_encode_chunked(const guchar *data, gsize len)
g_return_val_if_fail(data != NULL, NULL);
@@ -1993,13 +1993,12 @@
* address the link was pointing to. */
else if (href != NULL && g_ascii_strncasecmp(str2 + i, "</a>", 4) == 0)
size_t hrlen = strlen(href);
/* Only insert the href if it's different from the CDATA. */
- if ((hrlen != j - href_st ||
+ if ((hrlen != (gsize)(j - href_st) || strncmp(str2 + href_st, href, hrlen)) &&
- (hrlen != j - href_st + 7 || /* 7 == strlen("http://") */
+ (hrlen != (gsize)(j - href_st + 7) || /* 7 == strlen("http://") */ strncmp(str2 + href_st, href + 7, hrlen - 7)))
@@ -2701,7 +2700,7 @@
* It causes TOCTOU coverity warning (against g_rename below),
* but it's not a threat for us.
- if ((g_stat(filename_temp, &st) == -1) || (st.st_size != real_size))
+ if ((g_stat(filename_temp, &st) == -1) || ((gsize)st.st_size != real_size)) purple_debug_error("util", "Error writing data to file %s: "
"Incomplete file written; is your disk "
@@ -3306,7 +3305,7 @@
+ if (size == (size_t)-1) { return g_strdup(_("Calculating..."));
@@ -3421,7 +3420,7 @@
- len = MIN(sizeof(proto) - 1, (tmp - uri));
+ len = MIN(sizeof(proto) - 1, (gsize)(tmp - uri)); strncpy(proto, uri, len);
@@ -4107,7 +4106,7 @@
gfud->request_written += len;
- if (gfud->request_written < total_len)
+ if (gfud->request_written < (gsize)total_len) /* We're done writing our request, now start reading the response */
@@ -4349,7 +4348,7 @@
int bytes = g_unichar_to_utf8(c, utf_char);
- for (i = 0; i < bytes; i++) {
+ for (i = 0; (int)i < bytes; i++) { if (i >= sizeof(utf_char)) {
@@ -4842,7 +4841,7 @@
while ((p = strstr(start, pin)) != NULL) {
prev_char = g_utf8_find_prev_char(hay, p);
before = g_utf8_get_char(prev_char);
@@ -4853,8 +4852,8 @@
("!g_unichar_isalnum()" is not a valid way to determine word
boundaries, but it is the only reasonable thing to do here),
and isn't the '&' from a "&" or some such entity*/
- (before != -2 && !g_unichar_isalnum(before) && *(p - 1) != '&'))
- && after != -2 && !g_unichar_isalnum(after)) {
+ (before != (gunichar)-2 && !g_unichar_isalnum(before) && *(p - 1) != '&')) + && after != (gunichar)-2 && !g_unichar_isalnum(after)) { @@ -5008,7 +5007,7 @@
int bytes = g_unichar_to_utf8(c, utf_char);
- for (i = 0; i < bytes; i++) {
+ for (i = 0; (int)i < bytes; i++) { if (i >= sizeof(utf_char)) {
--- a/libpurple/xmlnode.c Wed Nov 12 19:15:24 2014 -0500
+++ b/libpurple/xmlnode.c Thu Nov 13 00:56:55 2014 -0500
@@ -109,7 +109,7 @@
g_return_if_fail(data != NULL);
g_return_if_fail(size != 0);
- real_size = size == -1 ? strlen(data) : size;
+ real_size = size == -1 ? strlen(data) : (gsize)size; child = new_node(NULL, XMLNODE_TYPE_DATA);
@@ -711,7 +711,7 @@
g_return_val_if_fail(str != NULL, NULL);
- real_size = size < 0 ? strlen(str) : size;
+ real_size = size < 0 ? strlen(str) : (gsize)size; xpd = g_new0(struct _xmlnode_parser_data, 1);
if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, real_size) < 0) {
--- a/pidgin/gtkconv.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkconv.c Thu Nov 13 00:56:55 2014 -0500
@@ -157,7 +157,7 @@
static const char *item_factory_translate_func (const char *path, gpointer func_data);
gboolean pidgin_conv_has_focus(PurpleConversation *conv);
static GdkColor* generate_nick_colors(guint *numcolors, GdkColor background);
-static gboolean color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast);
+static gboolean color_is_visible(GdkColor foreground, GdkColor background, guint color_contrast, guint brightness_contrast); static GtkTextTag *get_buddy_tag(PurpleConversation *conv, const char *who, PurpleMessageFlags flag, gboolean create);
static void pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields);
static void focus_out_from_menubar(GtkWidget *wid, PidginWindow *win);
@@ -4117,7 +4117,7 @@
while (purple_utf8_strcasecmp(tmp, *partial)) {
(*partial)[*most_matched] = '\0';
- if (*most_matched < strlen(tmp))
+ if (*most_matched < (goffset)strlen(tmp)) tmp[*most_matched] = '\0';
@@ -10195,7 +10195,7 @@
/* Algorithm from http://www.w3.org/TR/AERT#color-contrast */
-color_is_visible(GdkColor foreground, GdkColor background, int color_contrast, int brightness_contrast)
+color_is_visible(GdkColor foreground, GdkColor background, guint color_contrast, guint brightness_contrast) --- a/pidgin/gtkdebug.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkdebug.c Thu Nov 13 00:56:55 2014 -0500
@@ -429,7 +429,7 @@
gtk_tree_model_get(m, iter, 0, &text, 1, &level, -1);
- if (level >= purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel"))
+ if (level >= (PurpleDebugLevel)purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")) @@ -457,7 +457,7 @@
gtk_tree_model_get(m, iter, 0, &text, 1, &level, -1);
- if (level >= purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel"))
+ if (level >= (PurpleDebugLevel)purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")) gtk_imhtml_append_text(GTK_IMHTML(win->text), text, 0);
@@ -584,7 +584,7 @@
gtk_tree_model_get(model, iter, 0, &text, 1, &level, -1);
- if (level >= purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")) {
+ if (level >= (PurpleDebugLevel)purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")) { if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) {
@@ -722,7 +722,7 @@
item = gtk_check_menu_item_new_with_mnemonic(text[i]);
g_object_set_data(G_OBJECT(item), "user_data", GINT_TO_POINTER(value[i]));
g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(toolbar_icon_pref_changed), toolbar);
- if (value[i] == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style"))
+ if (value[i] == (GtkToolbarStyle)purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style")) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
--- a/pidgin/gtkft.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkft.c Thu Nov 13 00:56:55 2014 -0500
@@ -636,7 +636,7 @@
--- a/pidgin/gtkimhtml.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkimhtml.c Thu Nov 13 00:56:55 2014 -0500
@@ -1472,7 +1472,7 @@
GtkIMHtmlProtocol *proto = NULL;
- int length = reverse ? strlen(url) : -1;
+ int length = reverse ? strlen(url) : 0; klass = g_type_class_ref(GTK_TYPE_IMHTML);
for (iter = klass->protocols; iter; iter = iter->next) {
--- a/pidgin/gtkmain.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkmain.c Thu Nov 13 00:56:55 2014 -0500
@@ -248,7 +248,7 @@
--- a/pidgin/gtkprivacy.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkprivacy.c Thu Nov 13 00:56:55 2014 -0500
@@ -74,7 +74,7 @@
+ PurplePrivacyType type; @@ -206,12 +206,12 @@
select_account_cb(GtkWidget *dropdown, PurpleAccount *account,
PidginPrivacyDialog *dialog)
dialog->account = account;
for (i = 0; i < menu_entry_count; i++) {
- if (menu_entries[i].num == account->perm_deny) {
+ if (menu_entries[i].type == account->perm_deny) { gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i);
@@ -228,7 +228,8 @@
type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog)
- int new_type = menu_entries[gtk_combo_box_get_active(combo)].num;
+ PurplePrivacyType new_type = + menu_entries[gtk_combo_box_get_active(combo)].type; dialog->account->perm_deny = new_type;
serv_set_permit_deny(purple_account_get_connection(dialog->account));
@@ -335,8 +336,8 @@
dialog = g_new0(PidginPrivacyDialog, 1);
@@ -371,8 +372,8 @@
gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->type_menu),
_(menu_entries[i].text));
- if (menu_entries[i].num == dialog->account->perm_deny)
+ if (menu_entries[i].type == dialog->account->perm_deny) gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), selected);
--- a/pidgin/gtkrequest.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkrequest.c Thu Nov 13 00:56:55 2014 -0500
@@ -144,7 +144,7 @@
value = gtk_entry_get_text(GTK_ENTRY(data->u.input.entry));
- if (id < data->cb_count && data->cbs[id] != NULL)
+ if (id >= 0 && (gsize)id < data->cb_count && data->cbs[id] != NULL) ((PurpleRequestInputCb)data->cbs[id])(data->user_data, value);
else if (data->cbs[1] != NULL)
((PurpleRequestInputCb)data->cbs[1])(data->user_data, value);
@@ -160,7 +160,7 @@
generic_response_start(data);
- if (id < data->cb_count && data->cbs[id] != NULL)
+ if (id >= 0 && (gsize)id < data->cb_count && data->cbs[id] != NULL) ((PurpleRequestActionCb)data->cbs[id])(data->user_data, id);
purple_request_close(PURPLE_REQUEST_INPUT, data);
@@ -175,7 +175,7 @@
generic_response_start(data);
- if (id < data->cb_count && data->cbs[id] != NULL)
+ if (id >= 0 && (gsize)id < data->cb_count && data->cbs[id] != NULL) if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(group->data))) {
((PurpleRequestChoiceCb)data->cbs[id])(data->user_data, GPOINTER_TO_INT(g_object_get_data(G_OBJECT(group->data), "choice_id")));
@@ -599,7 +599,7 @@
char *primary_esc, *secondary_esc;
data = g_new0(PidginRequestData, 1);
data->type = PURPLE_REQUEST_ACTION;
--- a/pidgin/gtkstatusbox.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkstatusbox.c Thu Nov 13 00:56:55 2014 -0500
@@ -574,7 +574,7 @@
pidgin_status_box_finalize(GObject *obj)
PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj);
purple_signals_disconnect_by_handle(statusbox);
purple_prefs_disconnect_by_handle(statusbox);
@@ -873,7 +873,7 @@
/* This is a special case because Primitives for the token_status_account are actually
* saved statuses with substatuses for the enabled accounts */
if (status_box->token_status_account && purple_savedstatus_is_transient(saved_status)
- && type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE && primitive == GPOINTER_TO_INT(data))
+ && type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE && primitive == (PurpleStatusPrimitive)GPOINTER_TO_INT(data)) const char *acct_status_name = purple_status_get_name(
@@ -1189,7 +1189,7 @@
cache_pixbufs(PidginStatusBox *status_box)
g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL);
icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
--- a/pidgin/gtkthemes.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkthemes.c Thu Nov 13 00:56:55 2014 -0500
@@ -315,14 +315,14 @@
while (*i && !isspace(*i) && li < sizeof(l) - 1) {
if (*i == '\\' && *(i+1) != '\0')
/* coverity[tainted_data] */
next = g_utf8_next_char(i);
- if ((next - i) > (sizeof(l) - li -1)) {
+ if ((size_t)(next - i) > (sizeof(l) - li -1)) { --- a/pidgin/gtkutils.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/gtkutils.c Thu Nov 13 00:56:55 2014 -0500
@@ -300,7 +300,7 @@
for (i=0; i < data->len; i++) {
element = g_ptr_array_index(data,i);
--- a/pidgin/pidginstock.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/pidginstock.c Thu Nov 13 00:56:55 2014 -0500
@@ -403,7 +403,7 @@
pidgin_stock_load_status_icon_theme(PidginStatusIconTheme *theme)
GtkIconFactory *icon_factory;
GtkIconSet *translucent = NULL;
@@ -491,7 +491,7 @@
pidgin_stock_load_stock_icon_theme(PidginStockIconTheme *theme)
GtkIconFactory *icon_factory;
--- a/pidgin/plugins/pidginrc.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/plugins/pidginrc.c Thu Nov 13 00:56:55 2014 -0500
@@ -106,7 +106,7 @@
GString *style_string = g_string_new("");
@@ -370,7 +370,7 @@
GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL;
GtkSizeGroup *labelsg = NULL;
vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -409,7 +409,7 @@
GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
GtkSizeGroup *labelsg = NULL;
vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -469,7 +469,7 @@
* the size group not the whole thing, which isn't what I want. */
GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
GtkSizeGroup *labelsg = NULL;
vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -648,7 +648,7 @@
purplerc_init(PurplePlugin *plugin)
purple_prefs_add_none("/plugins");
purple_prefs_add_none("/plugins/gtk");
--- a/pidgin/plugins/spellchk.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/plugins/spellchk.c Thu Nov 13 00:56:55 2014 -0500
@@ -126,7 +126,8 @@
bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf);
- buf[MIN(bytes, sizeof(buf) - 1)] = '\0';
+ buf[MIN((gsize)bytes, sizeof(buf) - 1)] = '\0'; ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL);
@@ -675,10 +676,10 @@
-static int buf_get_line(char *ibuf, char **buf, int *position, gsize len)
+static int buf_get_line(char *ibuf, char **buf, gsize *position, gsize len)
@@ -1775,7 +1776,7 @@
gboolean complete = TRUE;
gboolean case_sensitive = FALSE;
--- a/pidgin/plugins/vvconfig.c Wed Nov 12 19:15:24 2014 -0500
+++ b/pidgin/plugins/vvconfig.c Thu Nov 13 00:56:55 2014 -0500
@@ -109,7 +109,7 @@
!(pspec = gst_property_probe_get_property(probe, "device"))) {
purple_debug_info("vvconfig", "'%s' - no device\n", element_name);
/* Set autoprobe[-fps] to FALSE to avoid delays when probing. */