X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fproto.c;h=acd66017fd91493f397fa3310677d7fa82f19eef;hp=62871b5d3285780ce6d0dfcd2d8b91feb074635a;hb=bf2b08560f649c22152e4138531ad0b46b4ad1b3;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf diff --git a/daemon/proto.c b/daemon/proto.c index 62871b5..acd6601 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; } }