From e44fe481e3c80ded7dc7c286fd2a3d0870d48cdb Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Wed, 1 Jun 2016 20:37:51 +0000 Subject: [PATCH] bandb/bandb: functions that call exit(3) should be marked noreturn, avoid sign overflow in integer function argument --- bandb/bandb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bandb/bandb.c b/bandb/bandb.c index 71a425d7..769f6fe4 100644 --- a/bandb/bandb.c +++ b/bandb/bandb.c @@ -236,6 +236,9 @@ parse_request(rb_helper *helper) } +static void +error_cb(rb_helper *helper) __attribute__((noreturn)); + static void error_cb(rb_helper *helper) { @@ -282,13 +285,16 @@ setup_signals(void) } +static void +db_error_cb(const char *errstr) __attribute__((noreturn)); + static void db_error_cb(const char *errstr) { char buf[256]; snprintf(buf, sizeof(buf), "! :%s", errstr); rb_helper_write(bandb_helper, "%s", buf); - rb_sleep(2 << 30, 0); + rb_sleep(1 << 30, 0); exit(1); }