mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
Pull request trivial branch 2019-05-03
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJczCVqAAoJEPMMOL0/L748fJgP/2egGeZwC/CwnMOf/8U27mp6 oINuhwZ+xM4Tb7ZaOJnyJIrXL5oJNXXc3EqhVS/m+bRM5WgvszWnAMVKr4aTqj5G exuqrIp9SRjvWd4giWHB8rgedIWuY6B5B6T6obvpwWJV3SNiNOGUeXbcF+oyH0L9 msp9PS4mzp/pEauBiulJOHSlqa9r/9AtP/liGp52vJ7wb6St+y1fLDlAbfPSYh6i XQUXy/ymR4JrEFXSH0mLXDDqpY6UW1z1PRaqoNKrr99pfvYn7M+zrVXkXBEFDLTA wMLiTGiOTR8P/bDhkiKCreWVsH6X93qMPS4kiAQnrT8FnDYMgKzG8rscG3a/DMZR 1cXrSh2mckupXQTXNaT0judoUYRXEDXu7fD7PlyXmNiAT1FkRLaBHUQ243DHzZ07 E3UD0ngsXSl5m6W3EDpGag5RlnFlyexPDDVkN3ZNPjmzStp0lOKplj24DXIz4xYf 9CpTAiVM16MH7PUWdIkhRGXk92n5giw+pZWynA2W5F7ykWIlV1lTTPLwt55g1aev ExdGTOH0qQ9s96AvQtBuomUzd45DfWLdL4Ixqf13uP4Diuy5XTZS8DnRZ/HGxKRN hTZXFxI3sVvRcLNId/hrjH6D8+Ou6W89RA8rfL762pc7zGsaD7+n9rqZQA1sDixh 9N0IHgrPbbLiWGbZ56vf =fRKG -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging Pull request trivial branch 2019-05-03 # gpg: Signature made Fri 03 May 2019 12:26:34 BST # gpg: using RSA key F30C38BD3F2FBE3C # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-pull-request: sockets: avoid string truncation warnings when copying UNIX path hw/sparc/leon3: Allow load of uImage firmwares Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts net: Print output of "-net nic, model=help" to stdout instead of stderr Header cleanups Update configure configure: fix pam test warning qom: use object_new_with_type in object_new_with_propv doc: fix the configuration path CODING_STYLE: indent example code as all others CODING_STYLE: specify the indent rule for multiline code hw/net/pcnet: Use qemu_log_mask(GUEST_ERROR) instead of printf Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
68a7b9724f
10 changed files with 74 additions and 25 deletions
|
@ -830,6 +830,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
|||
int sock, fd;
|
||||
char *pathbuf = NULL;
|
||||
const char *path;
|
||||
size_t pathlen;
|
||||
|
||||
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
|
@ -845,7 +846,8 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
|||
path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX", tmpdir);
|
||||
}
|
||||
|
||||
if (strlen(path) > sizeof(un.sun_path)) {
|
||||
pathlen = strlen(path);
|
||||
if (pathlen > sizeof(un.sun_path)) {
|
||||
error_setg(errp, "UNIX socket path '%s' is too long", path);
|
||||
error_append_hint(errp, "Path must be less than %zu bytes\n",
|
||||
sizeof(un.sun_path));
|
||||
|
@ -877,7 +879,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
|||
|
||||
memset(&un, 0, sizeof(un));
|
||||
un.sun_family = AF_UNIX;
|
||||
strncpy(un.sun_path, path, sizeof(un.sun_path));
|
||||
memcpy(un.sun_path, path, pathlen);
|
||||
|
||||
if (bind(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {
|
||||
error_setg_errno(errp, errno, "Failed to bind socket to %s", path);
|
||||
|
@ -901,6 +903,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
|||
{
|
||||
struct sockaddr_un un;
|
||||
int sock, rc;
|
||||
size_t pathlen;
|
||||
|
||||
if (saddr->path == NULL) {
|
||||
error_setg(errp, "unix connect: no path specified");
|
||||
|
@ -913,7 +916,8 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (strlen(saddr->path) > sizeof(un.sun_path)) {
|
||||
pathlen = strlen(saddr->path);
|
||||
if (pathlen > sizeof(un.sun_path)) {
|
||||
error_setg(errp, "UNIX socket path '%s' is too long", saddr->path);
|
||||
error_append_hint(errp, "Path must be less than %zu bytes\n",
|
||||
sizeof(un.sun_path));
|
||||
|
@ -922,7 +926,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
|||
|
||||
memset(&un, 0, sizeof(un));
|
||||
un.sun_family = AF_UNIX;
|
||||
strncpy(un.sun_path, saddr->path, sizeof(un.sun_path));
|
||||
memcpy(un.sun_path, saddr->path, pathlen);
|
||||
|
||||
/* connect to peer */
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue