aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-09-07 00:17:08 -0400
committerThomas Harning Jr <harningt@gmail.com>2007-09-07 00:17:08 -0400
commitb91e1c1b09f445ae1570aa39596e3ac2eaf4203a (patch)
tree502c483698857e2fb0edcd56906c2cfd7761b50f /src
parenta7c62b2e580b1456719cd0758b0c2230bc761836 (diff)
downloadluaevent-prosody-b91e1c1b09f445ae1570aa39596e3ac2eaf4203a.tar.gz
luaevent-prosody-b91e1c1b09f445ae1570aa39596e3ac2eaf4203a.zip
event_buffer:add learned not to append to itself...
Diffstat (limited to 'src')
-rw-r--r--src/event_buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/event_buffer.c b/src/event_buffer.c
index 9d7b182..546a596 100644
--- a/src/event_buffer.c
+++ b/src/event_buffer.c
@@ -78,6 +78,8 @@ static int event_buffer_add(lua_State* L) {
for(i = 2; i <= last; i++) {
if(!lua_isstring(L, i) && !is_event_buffer(L, i))
luaL_argerror(L, i, "Argument is not a string or buffer object");
+ if(lua_equal(L, 1, i))
+ luaL_argerror(L, i, "Cannot add buffer to itself");
/* Optionally perform checks and data loading separately to avoid overfilling the buffer */
#if BUFFER_ADD_CHECK_INPUT_FIRST
}