From 27a3f1ccf2fc049b479feb153badffe223911a62 Mon Sep 17 00:00:00 2001
From: Stefan Knoblich <stkn@openisdn.net>
Date: Fri, 6 Jan 2012 23:08:45 +0100
Subject: [PATCH] mod_httapi: Fix Cache-Control max-age= parameter string
 (length) check

This is probably what you had in mind...

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
---
 src/mod/applications/mod_httapi/mod_httapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c
index e88ce1d5c7..ae87ad5c40 100644
--- a/src/mod/applications/mod_httapi/mod_httapi.c
+++ b/src/mod/applications/mod_httapi/mod_httapi.c
@@ -1949,7 +1949,7 @@ static switch_status_t write_meta_file(http_file_context_t *context, const char
 		if (headers && (cc = switch_event_get_header(headers, "Cache-Control")) && (p = switch_stristr("max-age=", cc))) {
 			p += 8;
 			
-			if (p) {
+			if (!zstr(p)) {
 				ttl = atoi(p);
 				if (ttl < 0) ttl = globals.cache_ttl;
 			}