OSDN Git Service

gobex: Fix checking opcodes with final-bit set
authorJohan Hedberg <johan.hedberg@intel.com>
Sun, 26 Jun 2011 22:42:43 +0000 (01:42 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Dec 2012 21:21:56 +0000 (22:21 +0100)
gobex/gobex.c

index 3874f1b..c777ef6 100644 (file)
@@ -423,7 +423,7 @@ void g_obex_packet_free(GObexPacket *pkt)
 
 static ssize_t get_header_offset(guint8 opcode)
 {
-       switch (opcode) {
+       switch (opcode & ~G_OBEX_FINAL) {
        case G_OBEX_OP_CONNECT:
                return sizeof(struct connect_data);
        case G_OBEX_OP_SETPATH: