rpcbind: avoid dereferencing NULL from realloc()
Subsystems (2)
PATCH 1/1 rpcbind: avoid dereferencing NULL from realloc()
Signed-off-by Zhi Li <[email protected]>
--- src/rpcbind.c | 2 ++ 1 file changed, 2 insertions(+)
src/rpcbind.c +2 -0
@@ -471,6 +471,8 @@ init_transport(struct netconfig *nconf) nhostsbak = nhosts; nhostsbak++; hosts =realloc (hosts, nhostsbak *sizeof (char *)); +if (hosts ==NULL ) +errx (1 ,"Out of memory" );if (nhostsbak ==1 ) hosts[0 ] ="*" ;else {
Signature · 1 line
2.39.0
Quoted 3 lines · Zhi Li
Signed-off-by Zhi Li<[email protected]>
Committed... (tag: rpcbind-1_2_8-rc2)
steved.
Quoted 19 lines
--- src/rpcbind.c | 2 ++ 1 file changed, 2 insertions(+)src/rpcbind.c +2
-1@@ -471,6 +471,8 @@ init_transport(struct netconfig *nconf) nhostsbak = nhosts; nhostsbak++; hosts =realloc (hosts, nhostsbak *sizeof (char *)); +if (hosts ==NULL ) +errx (1 ,"Out of memory" );if (nhostsbak ==1 ) hosts[0 ] ="*" ;else { -- 2.39.0