From 0520c606ec60f13928d66eb11def055758631826 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 24 Feb 2006 00:11:37 +0000 Subject: [PATCH] fixed possible overrun bug --- amxmodx/format.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/amxmodx/format.cpp b/amxmodx/format.cpp index 0b39384a..4bc85a7a 100644 --- a/amxmodx/format.cpp +++ b/amxmodx/format.cpp @@ -390,15 +390,21 @@ reswitch: } case '%': *buf_p++ = static_cast(ch); + if (!llen) + goto done; llen--; break; case '\0': *buf_p++ = static_cast('%'); + if (!llen) + goto done; llen--; goto done; break; default: *buf_p++ = static_cast(ch); + if (!llen) + goto done; llen--; break; }