aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--env.c2
-rw-r--r--rfc822.c2
-rw-r--r--smbutil.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/env.c b/env.c
index 2ac5a622..5dd54032 100644
--- a/env.c
+++ b/env.c
@@ -290,7 +290,7 @@ char *visbuf(const char *buf)
needed = strlen(buf) * 5 + 1; /* worst case: HEX, plus NUL byte */
- if (needed > vbufs) {
+ if (!vbuf || needed > vbufs) {
vbufs = needed;
vbuf = (char *)xrealloc(vbuf, vbufs);
}
diff --git a/rfc822.c b/rfc822.c
index efa92f9c..beff379d 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -247,6 +247,8 @@ char *nxtaddr(const char *hdr /* header to be parsed, NUL to continue previous h
tp = 0;
}
+ if (!hp) return NULL;
+
for (; *hp; hp++)
{
#ifdef MAIN
diff --git a/smbutil.c b/smbutil.c
index 18aa1dc4..fd239d9c 100644
--- a/smbutil.c
+++ b/smbutil.c
@@ -85,7 +85,7 @@ static void dumpRaw(FILE *fp, unsigned char *buf, size_t len)
/* helper macro to destructively resize buffers; assumes that bufsiz
* is initialized to 0 if buf is unallocated! */
#define allocbuf(buf, bufsiz, need) do { \
- if ((need) > (bufsiz)) \
+ if (!buf || (need) > (bufsiz)) \
{ \
(bufsiz) = ((need) < 1024) ? 1024 : (need); \
xfree(buf); \