* [PATCH] [nfs/nfs-utils] rpcdebug: avoid buffer underflow if read() returns 0
@ 2023-03-09 6:20 Zhi Li
2023-04-05 16:28 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Zhi Li @ 2023-03-09 6:20 UTC (permalink / raw)
To: linux-nfs; +Cc: steved, Zhi Li
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2176740
Signed-off-by: Zhi Li <yieli@redhat.com>
---
tools/rpcdebug/rpcdebug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c
index 68206cc5..ec05179e 100644
--- a/tools/rpcdebug/rpcdebug.c
+++ b/tools/rpcdebug/rpcdebug.c
@@ -257,7 +257,7 @@ get_flags(char *module)
perror(filename);
exit(1);
}
- if ((len = read(sysfd, buffer, sizeof(buffer))) < 0) {
+ if ((len = read(sysfd, buffer, sizeof(buffer))) <= 0) {
perror("read");
exit(1);
}
--
2.39.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] [nfs/nfs-utils] rpcdebug: avoid buffer underflow if read() returns 0
2023-03-09 6:20 [PATCH] [nfs/nfs-utils] rpcdebug: avoid buffer underflow if read() returns 0 Zhi Li
@ 2023-04-05 16:28 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2023-04-05 16:28 UTC (permalink / raw)
To: Zhi Li, linux-nfs
On 3/9/23 1:20 AM, Zhi Li wrote:
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2176740
>
> Signed-off-by: Zhi Li <yieli@redhat.com>
Committed... (tag: nfs-utils-2-6-3-rc7)
steved.
> ---
> tools/rpcdebug/rpcdebug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c
> index 68206cc5..ec05179e 100644
> --- a/tools/rpcdebug/rpcdebug.c
> +++ b/tools/rpcdebug/rpcdebug.c
> @@ -257,7 +257,7 @@ get_flags(char *module)
> perror(filename);
> exit(1);
> }
> - if ((len = read(sysfd, buffer, sizeof(buffer))) < 0) {
> + if ((len = read(sysfd, buffer, sizeof(buffer))) <= 0) {
> perror("read");
> exit(1);
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-05 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09 6:20 [PATCH] [nfs/nfs-utils] rpcdebug: avoid buffer underflow if read() returns 0 Zhi Li
2023-04-05 16:28 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox