Commit f8cdec1d authored by Federico G. Schwindt's avatar Federico G. Schwindt

Tighten up checks

parent 932ed4af
...@@ -243,6 +243,9 @@ VTIM_parse(const char *p) ...@@ -243,6 +243,9 @@ VTIM_parse(const char *p)
int hour = 0, min = 0, sec = 0; int hour = 0, min = 0, sec = 0;
int d, leap; int d, leap;
if (p == NULL || *p == '\0')
FAIL();
while (*p == ' ') while (*p == ' ')
p++; p++;
......
...@@ -194,8 +194,6 @@ vmod_time(VRT_CTX, VCL_STRING p, VCL_TIME d) ...@@ -194,8 +194,6 @@ vmod_time(VRT_CTX, VCL_STRING p, VCL_TIME d)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
if (p == NULL)
return (d);
r = VTIM_parse(p); r = VTIM_parse(p);
if (r) if (r)
return (r); return (r);
......
...@@ -90,6 +90,9 @@ vmod_fileread(VRT_CTX, struct vmod_priv *priv, ...@@ -90,6 +90,9 @@ vmod_fileread(VRT_CTX, struct vmod_priv *priv,
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
AN(priv); AN(priv);
if (file_name == NULL)
return (NULL);
if (priv->priv != NULL) { if (priv->priv != NULL) {
CAST_OBJ_NOTNULL(frf, priv->priv, CACHED_FILE_MAGIC); CAST_OBJ_NOTNULL(frf, priv->priv, CACHED_FILE_MAGIC);
if (!strcmp(file_name, frf->file_name)) if (!strcmp(file_name, frf->file_name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment