r114923 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114922‎ | r114923 | r114924 >
Date:12:43, 16 April 2012
Author:hashar
Status:ok (Comments)
Tags:
Comment:
noclock mode missed some variables definition
Modified paths:
  • /trunk/php/luasandbox/luasandbox_timer.h (modified) (history)
  • /trunk/php/luasandbox/timer.c (modified) (history)

Diff [purge]

Index: trunk/php/luasandbox/timer.c
@@ -15,12 +15,13 @@
1616
1717 void luasandbox_timer_install_handler(struct sigaction * oldact) {}
1818 void luasandbox_timer_remove_handler(struct sigaction * oldact) {}
19 -void luasandbox_timer_start(luasandbox_timer_set * lts,
 19+void luasandbox_timer_start(luasandbox_timer_set * lts,
2020 php_luasandbox_obj * sandbox,
2121 struct timespec * normal_timeout,
2222 struct timespec * emergency_timeout) {}
2323 void luasandbox_timer_stop(luasandbox_timer_set * lts) {}
2424 void luasandbox_timer_timeout_error(lua_State *L) {}
 25+char luasandbox_timeout_message[];
2526
2627 #else
2728
Index: trunk/php/luasandbox/luasandbox_timer.h
@@ -38,6 +38,10 @@
3939 #define LUASANDBOX_NO_CLOCK
4040
4141 typedef struct {} luasandbox_timer;
 42+typedef struct {} luasandbox_timer_set;
 43+void timer_settime();
 44+void timer_delete();
 45+void timer_create();
4246
4347 #endif
4448

Comments

#Comment by Tim Starling (talk | contribs)   11:25, 26 April 2012

Declaring timer_settime(), timer_delete() and timer_create() appears to be unnecessary and potentially harmful. If anything refers to those when LUASANDBOX_NO_CLOCK is set, declaring them will just defer the error until link.

Also, if anything refers to luasandbox_timeout_message and it's an uninitialised array, a crash may result.

Status & tagging log