diff options
author | Thomas Harning Jr <harningt@gmail.com> | 2007-09-07 00:17:08 -0400 |
---|---|---|
committer | Thomas Harning Jr <harningt@gmail.com> | 2007-09-07 00:17:08 -0400 |
commit | b91e1c1b09f445ae1570aa39596e3ac2eaf4203a (patch) | |
tree | 502c483698857e2fb0edcd56906c2cfd7761b50f /src | |
parent | a7c62b2e580b1456719cd0758b0c2230bc761836 (diff) | |
download | luaevent-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.c | 2 |
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 } |