From: Olaf Hering <olaf@aepfle.de>
To: Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xenproject.org,
'Ian Jackson' <ian.jackson@eu.citrix.com>, 'Wei Liu' <wl@xen.org>,
paul@xen.org
Subject: Re: [PATCH v1] kdd: remove zero-length arrays
Date: Thu, 11 Jun 2020 21:10:04 +0200 [thread overview]
Message-ID: <20200611211004.11e38f8f.olaf@aepfle.de> (raw)
In-Reply-To: <20200610191657.GA69414@deinos.phlegethon.org>
[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]
Am Wed, 10 Jun 2020 20:16:57 +0100
schrieb Tim Deegan <tim@xen.org>:
> How tedious.
Indeed. This compiles for me as well:
--- orig/kdd.h 2020-06-08 17:40:05.000000000 +0000
+++ kdd.h 2020-06-11 19:00:44.234364040 +0000
@@ -68,7 +68,6 @@
uint16_t len; /* Payload length, excl. header and trailing byte */
uint32_t id; /* Echoed in responses */
uint32_t sum; /* Unsigned sum of all payload bytes */
- uint8_t payload[0];
} PACKED kdd_hdr;
#define KDD_PKT_CMD 0x0002 /* Debugger commands (and replies to them) */
@@ -323,7 +322,7 @@
kdd_msg msg;
kdd_reg reg;
kdd_stc stc;
- uint8_t payload[0];
+ uint8_t payload[65536];
};
} PACKED kdd_pkt;
--- orig/kdd.c 2020-06-08 17:40:05.000000000 +0000
+++ kdd.c 2020-06-11 19:08:36.775724640 +0000
@@ -79,11 +79,11 @@
/* State of the debugger stub */
typedef struct {
union {
- uint8_t txb[sizeof (kdd_hdr) + 65536]; /* Marshalling area for tx */
+ uint8_t txb[sizeof (kdd_hdr) + 0xffff]; /* Marshalling area for tx */
kdd_pkt txp; /* Also readable as a packet structure */
};
union {
- uint8_t rxb[sizeof (kdd_hdr) + 65536]; /* Marshalling area for rx */
+ uint8_t rxb[sizeof (kdd_hdr)]; /* Marshalling area for rx */
kdd_pkt rxp; /* Also readable as a packet structure */
};
unsigned int cur; /* Offset into rx where we'll put the next byte */
Olaf
[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-06-11 19:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 20:38 [PATCH v1] kdd: remove zero-length arrays Olaf Hering
2020-06-09 8:55 ` Paul Durrant
2020-06-09 9:00 ` Olaf Hering
2020-06-09 9:04 ` Paul Durrant
2020-06-09 9:06 ` Jürgen Groß
2020-06-09 9:08 ` Paul Durrant
2020-06-09 9:37 ` Olaf Hering
2020-06-09 12:15 ` Tim Deegan
2020-06-09 13:22 ` Olaf Hering
2020-06-09 13:26 ` Ian Jackson
2020-06-09 13:32 ` Olaf Hering
2020-06-10 19:16 ` Tim Deegan
2020-06-11 19:10 ` Olaf Hering [this message]
2020-06-16 20:50 ` Christopher Clark
2020-06-17 8:21 ` Paul Durrant
2020-06-26 10:26 ` Wei Liu
2020-06-26 10:31 ` Paul Durrant
2020-06-26 10:33 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200611211004.11e38f8f.olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=ian.jackson@eu.citrix.com \
--cc=paul@xen.org \
--cc=tim@xen.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.