diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-05 16:04:50 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-05 16:06:36 +0100 |
commit | 51d0620ad90f913cb749e641a839876b3ef755f8 (patch) | |
tree | 400d4a1a3d4dd3435be851810b813cf2f39d073f /daemon/proto.c | |
parent | a11cb4ac38cf245472d93e8df13c5ac630b883a7 (diff) | |
download | libguestfs-51d0620ad90f913cb749e641a839876b3ef755f8.tar.gz libguestfs-51d0620ad90f913cb749e641a839876b3ef755f8.tar.xz libguestfs-51d0620ad90f913cb749e641a839876b3ef755f8.zip |
Don't die if reply message is oversized (RHBZ#509597).
Diffstat (limited to 'daemon/proto.c')
-rw-r--r-- | daemon/proto.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/daemon/proto.c b/daemon/proto.c index 62871b5d..acd66017 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -266,9 +266,14 @@ reply (xdrproc_t xdrp, char *ret) } if (xdrp) { + /* This can fail if the reply body is too large, for example + * if it exceeds the maximum message size. In that case + * we want to return an error message instead. (RHBZ#509597). + */ if (!(*xdrp) (&xdr, ret)) { - fprintf (stderr, "guestfsd: failed to encode reply body\n"); - exit (1); + reply_with_perror ("guestfsd: failed to encode reply body\n"); + xdr_destroy (&xdr); + return; } } |