From 271e05917f7782db2301e04923423b00994c75db Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 17 Aug 2004 14:45:45 -0300 Subject: bug: lua_getupvalue and setupvalue do not check for index too small. --- bugs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bugs') diff --git a/bugs b/bugs index 5ad6f1c5..2efc9aba 100644 --- a/bugs +++ b/bugs @@ -669,3 +669,24 @@ patch = [[ ]] } + +Bug{ +what = [[lua_getupvalue and setupvalue do not check for index too small]], + +report = [[Mike Pall, ?/2004]], + +example = [[debug.getupvalue(function() end, 0)]], + +patch = [[ +* lapi.c +941c941 +< if (n > f->c.nupvalues) return NULL; +--- +> if (!(1 <= n && n <= f->c.nupvalues)) return NULL; +947c947 +< if (n > p->sizeupvalues) return NULL; +--- +> if (!(1 <= n && n <= p->sizeupvalues)) return NULL; +]] +} + -- cgit v1.2.1