[Pidgin] #11958: Get Info on contact doesn't work with Gadu-Gadu protocol.
Pidgin
trac at pidgin.im
Sat Mar 12 11:57:15 EST 2011
#11958: Get Info on contact doesn't work with Gadu-Gadu protocol.
-----------------------------+----------------------------------------------
Reporter: diskape | Owner: bartosz
Type: defect | Status: new
Milestone: Patches welcome | Component: Gadu-Gadu
Version: 2.7.0 | Resolution:
Keywords: |
-----------------------------+----------------------------------------------
Comment(by matekm):
Ok, I found the root of the problem: it's look like there is an issue with
struct alignment on Windows.
There are some cast to '''struct gg_pubdir50_reply *''' used in
'''gg_pubdir50''' (pubdir50.cc):
{{{
r = (struct gg_pubdir50_request*) buf;
r->type = req->type;
r->seq = gg_fix32(req->seq);
}}}
Because '''struct gg_pubdir50_reply''' is defined as packed, sizeof(*r)
should be 5 (uint8_t + uint32_t). But it isn't, it is 8.
So, in memory we have:
{
0x00000003 /* type */
0xE4927B4d /* seq number */
}
but then we have
{{{
for (i = 0, p = buf + 5; i < req->entries_count; i++) {
}}}
and we override seq number with search data.
The same situation is in gg_pubdir50_handle_reply_sess - the same
alignment problem.
Because of this we can't correctly retrieve sequence number and can't
correctly lookup form in hash table.
I replaced casts to the struct with memcpy and pubdir search started
working.
Now, I don't think that this is problem with pidgin/libgadu (I copy the gg
implementation from 2.6.6 and the pubdir search wasn't working too).
Rather this is cygwing/mingw issue. Any idea what changed in those tools?
How can this be fixed?
--
Ticket URL: <http://developer.pidgin.im/ticket/11958#comment:32>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list