[PATCH] Fix new CIDs
Volker Lendecke
Volker.Lendecke at SerNet.DE
Tue Mar 1 11:47:29 UTC 2016
Hi!
Review appreciated!
Thanks, Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 95dc6f6ce75e12fb31ca4d3294913673deb13fd1 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 1 Mar 2016 12:42:37 +0100
Subject: [PATCH 1/2] ntvfs: Fix CID 1354522 Unchecked return value
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source4/ntvfs/nbench/vfs_nbench.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c
index 42a3f36..e6f725a 100644
--- a/source4/ntvfs/nbench/vfs_nbench.c
+++ b/source4/ntvfs/nbench/vfs_nbench.c
@@ -46,11 +46,16 @@ static void nbench_log(struct ntvfs_request *req,
struct nbench_private *nprivates = req->async_states->ntvfs->private_data;
va_list ap;
char *s = NULL;
+ int ret;
va_start(ap, format);
- vasprintf(&s, format, ap);
+ ret = vasprintf(&s, format, ap);
va_end(ap);
+ if (ret == -1) {
+ return;
+ }
+
write(nprivates->log_fd, s, strlen(s));
free(s);
}
--
1.7.9.5
From 148bfa4375c955248cbe1f2d78f97a39875cdab4 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 1 Mar 2016 12:43:32 +0100
Subject: [PATCH 2/2] lib: Fix 1354521 Unchecked return value
Signed-off-by: Volker Lendecke <vl at samba.org>
---
lib/tdr/tdr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/tdr/tdr.c b/lib/tdr/tdr.c
index 95ef982..401e1cc 100644
--- a/lib/tdr/tdr.c
+++ b/lib/tdr/tdr.c
@@ -392,12 +392,16 @@ void tdr_print_debug_helper(struct tdr_print *tdr, const char *format, ...)
{
va_list ap;
char *s = NULL;
- int i;
+ int i, ret;
va_start(ap, format);
- vasprintf(&s, format, ap);
+ ret = vasprintf(&s, format, ap);
va_end(ap);
+ if (ret == -1) {
+ return;
+ }
+
for (i=0;i<tdr->level;i++) { DEBUG(0,(" ")); }
DEBUG(0,("%s\n", s));
--
1.7.9.5
More information about the samba-technical
mailing list