X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fproto.c;h=acd66017fd91493f397fa3310677d7fa82f19eef;hp=3ca4316ac2bd248d7bbcdc16c3d855614541062f;hb=4fbd283c67831d8ef0f0b49045b3369f3ce036db;hpb=62e41312acd0f7fe7f3622a73d6f6efc27b1b511 diff --git a/daemon/proto.c b/daemon/proto.c index 3ca4316..acd6601 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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; } }