idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
29,300
static void cgsleep_spec(struct timespec *ts_diff, const struct timespec *ts_start) { struct timespec now; timeraddspec(ts_diff, ts_start); cgtimer_time(&now); timersubspec(ts_diff, &now); if (unlikely(ts_diff->tv_sec < 0)) return; nanosleep(ts_diff, NULL); }
DoS
0
static void cgsleep_spec(struct timespec *ts_diff, const struct timespec *ts_start) { struct timespec now; timeraddspec(ts_diff, ts_start); cgtimer_time(&now); timersubspec(ts_diff, &now); if (unlikely(ts_diff->tv_sec < 0)) return; nanosleep(ts_diff, NULL); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,301
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { struct timespec ts_end; us_to_timespec(&ts_end, us); timeraddspec(&ts_end, ts_start); nanosleep_abstime(&ts_end); }
DoS
0
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { struct timespec ts_end; us_to_timespec(&ts_end, us); timeraddspec(&ts_end, ts_start); nanosleep_abstime(&ts_end); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,302
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { LARGE_INTEGER li; int ms; li.QuadPart = ts_start->QuadPart + us * 10LL; ms = us / 1000; if (!ms) ms = 1; liSleep(&li, ms); }
DoS
0
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { LARGE_INTEGER li; int ms; li.QuadPart = ts_start->QuadPart + us * 10LL; ms = us / 1000; if (!ms) ms = 1; liSleep(&li, ms); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,303
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { struct timespec ts_diff; us_to_timespec(&ts_diff, us); cgsleep_spec(&ts_diff, ts_start); }
DoS
0
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us) { struct timespec ts_diff; us_to_timespec(&ts_diff, us); cgsleep_spec(&ts_diff, ts_start); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,304
void cgtime(struct timeval *tv) { lldiv_t lidiv; decius_time(&lidiv); tv->tv_sec = lidiv.quot; tv->tv_usec = lidiv.rem / 10; }
DoS
0
void cgtime(struct timeval *tv) { lldiv_t lidiv; decius_time(&lidiv); tv->tv_sec = lidiv.quot; tv->tv_usec = lidiv.rem / 10; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,305
void cgtime(struct timeval *tv) { gettimeofday(tv, NULL); }
DoS
0
void cgtime(struct timeval *tv) { gettimeofday(tv, NULL); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,306
void cgtimer_sub(cgtimer_t *a, cgtimer_t *b, cgtimer_t *res) { res->tv_sec = a->tv_sec - b->tv_sec; res->tv_nsec = a->tv_nsec - b->tv_nsec; if (res->tv_nsec < 0) { res->tv_nsec += 1000000000; res->tv_sec--; } }
DoS
0
void cgtimer_sub(cgtimer_t *a, cgtimer_t *b, cgtimer_t *res) { res->tv_sec = a->tv_sec - b->tv_sec; res->tv_nsec = a->tv_nsec - b->tv_nsec; if (res->tv_nsec < 0) { res->tv_nsec += 1000000000; res->tv_sec--; } }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,307
void cgtimer_sub(cgtimer_t *a, cgtimer_t *b, cgtimer_t *res) { res->QuadPart = a->QuadPart - b->QuadPart; }
DoS
0
void cgtimer_sub(cgtimer_t *a, cgtimer_t *b, cgtimer_t *res) { res->QuadPart = a->QuadPart - b->QuadPart; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,308
void cgtimer_time(cgtimer_t *ts_start) { clock_gettime(CLOCK_MONOTONIC, ts_start); }
DoS
0
void cgtimer_time(cgtimer_t *ts_start) { clock_gettime(CLOCK_MONOTONIC, ts_start); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,309
void cgtimer_time(cgtimer_t *ts_start) { clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock); clock_get_time(cclock, &mts); mach_port_deallocate(mach_task_self(), cclock); ts_start->tv_sec = mts.tv_sec; ts_start->tv_nsec = mts.tv_nsec; }
DoS
0
void cgtimer_time(cgtimer_t *ts_start) { clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock); clock_get_time(cclock, &mts); mach_port_deallocate(mach_task_self(), cclock); ts_start->tv_sec = mts.tv_sec; ts_start->tv_nsec = mts.tv_nsec; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,310
void cgtimer_time(cgtimer_t *ts_start) { struct timeval tv; cgtime(&tv); ts_start->tv_sec = tv->tv_sec; ts_start->tv_nsec = tv->tv_usec * 1000; }
DoS
0
void cgtimer_time(cgtimer_t *ts_start) { struct timeval tv; cgtime(&tv); ts_start->tv_sec = tv->tv_sec; ts_start->tv_nsec = tv->tv_usec * 1000; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,311
void cgtimer_time(cgtimer_t *ts_start) { FILETIME ft; GetSystemTimeAsFileTime(&ft); ts_start->LowPart = ft.dwLowDateTime; ts_start->HighPart = ft.dwHighDateTime; }
DoS
0
void cgtimer_time(cgtimer_t *ts_start) { FILETIME ft; GetSystemTimeAsFileTime(&ft); ts_start->LowPart = ft.dwLowDateTime; ts_start->HighPart = ft.dwHighDateTime; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,312
int cgtimer_to_ms(cgtimer_t *cgt) { return timespec_to_ms(cgt); }
DoS
0
int cgtimer_to_ms(cgtimer_t *cgt) { return timespec_to_ms(cgt); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,313
static void clear_sock(struct pool *pool) { ssize_t n; mutex_lock(&pool->stratum_lock); do { if (pool->sock) n = recv(pool->sock, pool->sockbuf, RECVSIZE, 0); else n = 0; } while (n > 0); mutex_unlock(&pool->stratum_lock); clear_sockbuf(pool); }
DoS
0
static void clear_sock(struct pool *pool) { ssize_t n; mutex_lock(&pool->stratum_lock); do { if (pool->sock) n = recv(pool->sock, pool->sockbuf, RECVSIZE, 0); else n = 0; } while (n > 0); mutex_unlock(&pool->stratum_lock); clear_sockbuf(pool); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,314
static void clear_sockbuf(struct pool *pool) { strcpy(pool->sockbuf, ""); }
DoS
0
static void clear_sockbuf(struct pool *pool) { strcpy(pool->sockbuf, ""); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,315
void *completion_thread(void *arg) { struct cg_completion *cgc = (struct cg_completion *)arg; pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); cgc->fn(cgc->fnarg); cgsem_post(&cgc->cgsem); return NULL; }
DoS
0
void *completion_thread(void *arg) { struct cg_completion *cgc = (struct cg_completion *)arg; pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); cgc->fn(cgc->fnarg); cgsem_post(&cgc->cgsem); return NULL; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,316
void copy_time(struct timeval *dest, const struct timeval *src) { memcpy(dest, src, sizeof(struct timeval)); }
DoS
0
void copy_time(struct timeval *dest, const struct timeval *src) { memcpy(dest, src, sizeof(struct timeval)); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,317
static int curl_debug_cb(__maybe_unused CURL *handle, curl_infotype type, __maybe_unused char *data, size_t size, void *userdata) { struct pool *pool = (struct pool *)userdata; switch(type) { case CURLINFO_HEADER_IN: case CURLINFO_DATA_IN: case CURLINFO_SSL_DATA_IN: pool->sgminer_pool_stats.net_bytes_re...
DoS
0
static int curl_debug_cb(__maybe_unused CURL *handle, curl_infotype type, __maybe_unused char *data, size_t size, void *userdata) { struct pool *pool = (struct pool *)userdata; switch(type) { case CURLINFO_HEADER_IN: case CURLINFO_DATA_IN: case CURLINFO_SSL_DATA_IN: pool->sgminer_pool_stats.net_bytes_re...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,318
static void databuf_free(struct data_buffer *db) { if (!db) return; free(db->buf); memset(db, 0, sizeof(*db)); }
DoS
0
static void databuf_free(struct data_buffer *db) { if (!db) return; free(db->buf); memset(db, 0, sizeof(*db)); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,319
static void decius_time(lldiv_t *lidiv) { FILETIME ft; LARGE_INTEGER li; GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; li.QuadPart -= EPOCHFILETIME; /* SystemTime is in decimicroseconds so divide by an unusual number */ *lidiv = lldiv(li.QuadPart, 10000000); }
DoS
0
static void decius_time(lldiv_t *lidiv) { FILETIME ft; LARGE_INTEGER li; GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; li.QuadPart -= EPOCHFILETIME; /* SystemTime is in decimicroseconds so divide by an unusual number */ *lidiv = lldiv(li.QuadPart, 10000000); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,320
void dev_error(struct cgpu_info *dev, enum dev_reason reason) { dev->device_last_not_well = time(NULL); dev->device_not_well_reason = reason; switch (reason) { case REASON_THREAD_FAIL_INIT: dev->thread_fail_init_count++; break; case REASON_THREAD_ZERO_HASH: dev->thread_zero_hash_count++; break; ca...
DoS
0
void dev_error(struct cgpu_info *dev, enum dev_reason reason) { dev->device_last_not_well = time(NULL); dev->device_not_well_reason = reason; switch (reason) { case REASON_THREAD_FAIL_INIT: dev->thread_fail_init_count++; break; case REASON_THREAD_ZERO_HASH: dev->thread_zero_hash_count++; break; ca...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,321
bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port) { char *url_begin, *url_end, *ipv6_begin, *ipv6_end, *port_start = NULL; char url_address[256], port[6]; int url_len, port_len = 0; *sockaddr_url = url; url_begin = strstr(url, "//"); if (!url_begin) url_begin = url; else url_begin ...
DoS
0
bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port) { char *url_begin, *url_end, *ipv6_begin, *ipv6_end, *port_start = NULL; char url_address[256], port[6]; int url_len, port_len = 0; *sockaddr_url = url; url_begin = strstr(url, "//"); if (!url_begin) url_begin = url; else url_begin ...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,322
bool fulltest(const unsigned char *hash, const unsigned char *target) { uint32_t *hash32 = (uint32_t *)hash; uint32_t *target32 = (uint32_t *)target; bool rc = true; int i; for (i = 28 / 4; i >= 0; i--) { uint32_t h32tmp = le32toh(hash32[i]); uint32_t t32tmp = le32toh(target32[i]); if (h32tmp > t32tmp) { ...
DoS
0
bool fulltest(const unsigned char *hash, const unsigned char *target) { uint32_t *hash32 = (uint32_t *)hash; uint32_t *target32 = (uint32_t *)target; bool rc = true; int i; for (i = 28 / 4; i >= 0; i--) { uint32_t h32tmp = le32toh(hash32[i]); uint32_t t32tmp = le32toh(target32[i]); if (h32tmp > t32tmp) { ...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,323
static char *get_sessionid(json_t *val) { char *ret = NULL; json_t *arr_val; int arrsize, i; arr_val = json_array_get(val, 0); if (!arr_val || !json_is_array(arr_val)) goto out; arrsize = json_array_size(arr_val); for (i = 0; i < arrsize; i++) { json_t *arr = json_array_get(arr_val, i); char *notify; i...
DoS
0
static char *get_sessionid(json_t *val) { char *ret = NULL; json_t *arr_val; int arrsize, i; arr_val = json_array_get(val, 0); if (!arr_val || !json_is_array(arr_val)) goto out; arrsize = json_array_size(arr_val); for (i = 0; i < arrsize; i++) { json_t *arr = json_array_get(arr_val, i); char *notify; i...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,324
bool hex2bin(unsigned char *p, const char *hexstr, size_t len) { int nibble1, nibble2; unsigned char idx; bool ret = false; while (*hexstr && len) { if (unlikely(!hexstr[1])) { applog(LOG_ERR, "hex2bin str truncated"); return ret; } idx = *hexstr++; nibble1 = hex2bin_tbl[idx]; idx = *hexstr++; n...
DoS
0
bool hex2bin(unsigned char *p, const char *hexstr, size_t len) { int nibble1, nibble2; unsigned char idx; bool ret = false; while (*hexstr && len) { if (unlikely(!hexstr[1])) { applog(LOG_ERR, "hex2bin str truncated"); return ret; } idx = *hexstr++; nibble1 = hex2bin_tbl[idx]; idx = *hexstr++; n...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,325
static bool http_negotiate(struct pool *pool, int sockd, bool http0) { char buf[1024]; int i, len; if (http0) { snprintf(buf, 1024, "CONNECT %s:%s HTTP/1.0\r\n\r\n", pool->sockaddr_url, pool->stratum_port); } else { snprintf(buf, 1024, "CONNECT %s:%s HTTP/1.1\r\nHost: %s:%s\r\n\r\n", pool->sockaddr_url, ...
DoS
0
static bool http_negotiate(struct pool *pool, int sockd, bool http0) { char buf[1024]; int i, len; if (http0) { snprintf(buf, 1024, "CONNECT %s:%s HTTP/1.0\r\n\r\n", pool->sockaddr_url, pool->stratum_port); } else { snprintf(buf, 1024, "CONNECT %s:%s HTTP/1.1\r\nHost: %s:%s\r\n\r\n", pool->sockaddr_url, ...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,326
bool initiate_stratum(struct pool *pool) { bool ret = false, recvd = false, noresume = false, sockd = false; char s[RBUFSIZE], *sret = NULL, *nonce1, *sessionid; json_t *val = NULL, *res_val, *err_val; json_error_t err; int n2size; resend: if (!setup_stratum_socket(pool)) { /* FIXME: change to LOG_DEBUG when i...
DoS
0
bool initiate_stratum(struct pool *pool) { bool ret = false, recvd = false, noresume = false, sockd = false; char s[RBUFSIZE], *sret = NULL, *nonce1, *sessionid; json_t *val = NULL, *res_val, *err_val; json_error_t err; int n2size; resend: if (!setup_stratum_socket(pool)) { /* FIXME: change to LOG_DEBUG when i...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,327
static char *json_array_string(json_t *val, unsigned int entry) { char *buf = __json_array_string(val, entry); if (buf) return strdup(buf); return NULL; }
DoS
0
static char *json_array_string(json_t *val, unsigned int entry) { char *buf = __json_array_string(val, entry); if (buf) return strdup(buf); return NULL; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,328
json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass, const char *rpc_req, bool probe, bool longpoll, int *rolltime, struct pool *pool, bool share) { long timeout = longpoll ? (60 * 60) : 60; struct data_buffer all_data = {NULL, 0}; struct header_info hi = {NULL, 0, NULL, N...
DoS
0
json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass, const char *rpc_req, bool probe, bool longpoll, int *rolltime, struct pool *pool, bool share) { long timeout = longpoll ? (60 * 60) : 60; struct data_buffer all_data = {NULL, 0}; struct header_info hi = {NULL, 0, NULL, N...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,329
static void keep_curlalive(CURL *curl) { SOCKETTYPE sock; curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, (long *)&sock); keep_sockalive(sock); }
DoS
0
static void keep_curlalive(CURL *curl) { SOCKETTYPE sock; curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, (long *)&sock); keep_sockalive(sock); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,330
static void keep_sockalive(SOCKETTYPE fd) { const int tcp_one = 1; #ifndef WIN32 const int tcp_keepidle = 45; const int tcp_keepintvl = 30; int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif setsockopt(fd, SOL_SOCKET, SO...
DoS
0
static void keep_sockalive(SOCKETTYPE fd) { const int tcp_one = 1; #ifndef WIN32 const int tcp_keepidle = 45; const int tcp_keepintvl = 30; int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif setsockopt(fd, SOL_SOCKET, SO...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,331
static void last_nettime(struct timeval *last) { rd_lock(&netacc_lock); last->tv_sec = nettime.tv_sec; last->tv_usec = nettime.tv_usec; rd_unlock(&netacc_lock); }
DoS
0
static void last_nettime(struct timeval *last) { rd_lock(&netacc_lock); last->tv_sec = nettime.tv_sec; last->tv_usec = nettime.tv_usec; rd_unlock(&netacc_lock); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,332
int ms_tdiff(struct timeval *end, struct timeval *start) { /* Like us_tdiff, limit to 1 hour. */ if (unlikely(end->tv_sec - start->tv_sec > 3600)) return 3600000; return (end->tv_sec - start->tv_sec) * 1000 + (end->tv_usec - start->tv_usec) / 1000; }
DoS
0
int ms_tdiff(struct timeval *end, struct timeval *start) { /* Like us_tdiff, limit to 1 hour. */ if (unlikely(end->tv_sec - start->tv_sec > 3600)) return 3600000; return (end->tv_sec - start->tv_sec) * 1000 + (end->tv_usec - start->tv_usec) / 1000; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,333
void ms_to_timeval(struct timeval *val, int64_t ms) { lldiv_t tvdiv = lldiv(ms, 1000); val->tv_sec = tvdiv.quot; val->tv_usec = tvdiv.rem * 1000; }
DoS
0
void ms_to_timeval(struct timeval *val, int64_t ms) { lldiv_t tvdiv = lldiv(ms, 1000); val->tv_sec = tvdiv.quot; val->tv_usec = tvdiv.rem * 1000; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,334
static void nanosleep_abstime(struct timespec *ts_end) { int ret; do { ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, ts_end, NULL); } while (ret == EINTR); }
DoS
0
static void nanosleep_abstime(struct timespec *ts_end) { int ret; do { ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, ts_end, NULL); } while (ret == EINTR); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,335
static void noblock_socket(SOCKETTYPE fd) { #ifndef WIN32 int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif }
DoS
0
static void noblock_socket(SOCKETTYPE fd) { #ifndef WIN32 int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,336
bool parse_method(struct pool *pool, char *s) { json_t *val = NULL, *method, *err_val, *params; json_error_t err; bool ret = false; char *buf; if (!s) return ret; val = JSON_LOADS(s, &err); if (!val) { applog(LOG_INFO, "JSON decode failed(%d): %s", err.line, err.text); return ret; } method = json_obje...
DoS
0
bool parse_method(struct pool *pool, char *s) { json_t *val = NULL, *method, *err_val, *params; json_error_t err; bool ret = false; char *buf; if (!s) return ret; val = JSON_LOADS(s, &err); if (!val) { applog(LOG_INFO, "JSON decode failed(%d): %s", err.line, err.text); return ret; } method = json_obje...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,337
static bool parse_reconnect(struct pool *pool, json_t *val) { if (opt_disable_client_reconnect) { applog(LOG_WARNING, "Stratum client.reconnect received but is disabled, not reconnecting."); return false; } char *url, *port, address[256]; char *sockaddr_url, *stratum_port, *tmp; /* Tempvars. */ url = (char *...
DoS
0
static bool parse_reconnect(struct pool *pool, json_t *val) { if (opt_disable_client_reconnect) { applog(LOG_WARNING, "Stratum client.reconnect received but is disabled, not reconnecting."); return false; } char *url, *port, address[256]; char *sockaddr_url, *stratum_port, *tmp; /* Tempvars. */ url = (char *...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,338
const char *proxytype(proxytypes_t proxytype) { int i; for (i = 0; proxynames[i].name; i++) if (proxynames[i].proxytype == proxytype) return proxynames[i].name; return "invalid"; }
DoS
0
const char *proxytype(proxytypes_t proxytype) { int i; for (i = 0; proxynames[i].name; i++) if (proxynames[i].proxytype == proxytype) return proxynames[i].name; return "invalid"; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,339
static void recalloc_sock(struct pool *pool, size_t len) { size_t old, newlen; old = strlen(pool->sockbuf); newlen = old + len + 1; if (newlen < pool->sockbuf_size) return; newlen = newlen + (RBUFSIZE - (newlen % RBUFSIZE)); pool->sockbuf = (char *)realloc(pool->sockbuf, newlen); if (!pool->sockbuf) quither...
DoS
0
static void recalloc_sock(struct pool *pool, size_t len) { size_t old, newlen; old = strlen(pool->sockbuf); newlen = old + len + 1; if (newlen < pool->sockbuf_size) return; newlen = newlen + (RBUFSIZE - (newlen % RBUFSIZE)); pool->sockbuf = (char *)realloc(pool->sockbuf, newlen); if (!pool->sockbuf) quither...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,340
static size_t resp_hdr_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct header_info *hi = (struct header_info *)user_data; size_t remlen, slen, ptrlen = size * nmemb; char *rem, *val = NULL, *key = NULL; void *tmp; val = (char *)calloc(1, ptrlen); key = (char *)calloc(1, ptrlen); if (!key || !...
DoS
0
static size_t resp_hdr_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct header_info *hi = (struct header_info *)user_data; size_t remlen, slen, ptrlen = size * nmemb; char *rem, *val = NULL, *key = NULL; void *tmp; val = (char *)calloc(1, ptrlen); key = (char *)calloc(1, ptrlen); if (!key || !...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,341
bool restart_stratum(struct pool *pool) { applog(LOG_DEBUG, "Restarting stratum on pool %s", get_pool_name(pool)); if (pool->stratum_active) suspend_stratum(pool); if (!initiate_stratum(pool)) return false; if (pool->extranonce_subscribe && !subscribe_extranonce(pool)) return false; if (!auth_stratum(pool))...
DoS
0
bool restart_stratum(struct pool *pool) { applog(LOG_DEBUG, "Restarting stratum on pool %s", get_pool_name(pool)); if (pool->stratum_active) suspend_stratum(pool); if (!initiate_stratum(pool)) return false; if (pool->extranonce_subscribe && !subscribe_extranonce(pool)) return false; if (!auth_stratum(pool))...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,342
static bool send_version(struct pool *pool, json_t *val) { char s[RBUFSIZE]; int id = json_integer_value(json_object_get(val, "id")); if (!id) return false; sprintf(s, "{\"id\": %d, \"result\": \""PACKAGE"/"VERSION"\", \"error\": null}", id); if (!stratum_send(pool, s, strlen(s))) return false; return true...
DoS
0
static bool send_version(struct pool *pool, json_t *val) { char s[RBUFSIZE]; int id = json_integer_value(json_object_get(val, "id")); if (!id) return false; sprintf(s, "{\"id\": %d, \"result\": \""PACKAGE"/"VERSION"\", \"error\": null}", id); if (!stratum_send(pool, s, strlen(s))) return false; return true...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,343
static void set_nettime(void) { wr_lock(&netacc_lock); cgtime(&nettime); wr_unlock(&netacc_lock); }
DoS
0
static void set_nettime(void) { wr_lock(&netacc_lock); cgtime(&nettime); wr_unlock(&netacc_lock); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,344
static bool setup_stratum_socket(struct pool *pool) { struct addrinfo servinfobase, *servinfo, *hints, *p; char *sockaddr_url, *sockaddr_port; int sockd; int ret; mutex_lock(&pool->stratum_lock); pool->stratum_active = false; if (pool->sock) { /* FIXME: change to LOG_DEBUG if issue #88 resolved */ applog(LO...
DoS
0
static bool setup_stratum_socket(struct pool *pool) { struct addrinfo servinfobase, *servinfo, *hints, *p; char *sockaddr_url, *sockaddr_port; int sockd; int ret; mutex_lock(&pool->stratum_lock); pool->stratum_active = false; if (pool->sock) { /* FIXME: change to LOG_DEBUG if issue #88 resolved */ applog(LO...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,345
static bool sock_connecting(void) { #ifndef WIN32 return errno == EINPROGRESS; #else return WSAGetLastError() == WSAEWOULDBLOCK; #endif }
DoS
0
static bool sock_connecting(void) { #ifndef WIN32 return errno == EINPROGRESS; #else return WSAGetLastError() == WSAEWOULDBLOCK; #endif }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,346
bool sock_full(struct pool *pool) { if (strlen(pool->sockbuf)) return true; return (socket_full(pool, 0)); }
DoS
0
bool sock_full(struct pool *pool) { if (strlen(pool->sockbuf)) return true; return (socket_full(pool, 0)); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,347
static bool socket_full(struct pool *pool, int wait) { SOCKETTYPE sock = pool->sock; struct timeval timeout; fd_set rd; if (unlikely(wait < 0)) wait = 0; FD_ZERO(&rd); FD_SET(sock, &rd); timeout.tv_usec = 0; timeout.tv_sec = wait; if (select(sock + 1, &rd, NULL, NULL, &timeout) > 0) return true; return f...
DoS
0
static bool socket_full(struct pool *pool, int wait) { SOCKETTYPE sock = pool->sock; struct timeval timeout; fd_set rd; if (unlikely(wait < 0)) wait = 0; FD_ZERO(&rd); FD_SET(sock, &rd); timeout.tv_usec = 0; timeout.tv_sec = wait; if (select(sock + 1, &rd, NULL, NULL, &timeout) > 0) return true; return f...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,348
static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a) { unsigned short port; in_addr_t inp; char buf[515]; int i, len; int ret; buf[0] = 0x04; buf[1] = 0x01; port = atoi(pool->stratum_port); buf[2] = port >> 8; buf[3] = port & 0xff; sprintf(&buf[8], "SGMINER"); /* See if we've been give...
DoS
0
static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a) { unsigned short port; in_addr_t inp; char buf[515]; int i, len; int ret; buf[0] = 0x04; buf[1] = 0x01; port = atoi(pool->stratum_port); buf[2] = port >> 8; buf[3] = port & 0xff; sprintf(&buf[8], "SGMINER"); /* See if we've been give...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,349
static bool socks5_negotiate(struct pool *pool, int sockd) { unsigned char atyp, uclen; unsigned short port; char buf[515]; int i, len; buf[0] = 0x05; buf[1] = 0x01; buf[2] = 0x00; applog(LOG_DEBUG, "Attempting to negotiate with %s:%s SOCKS5 proxy", pool->sockaddr_proxy_url, pool->sockaddr_proxy_port )...
DoS
0
static bool socks5_negotiate(struct pool *pool, int sockd) { unsigned char atyp, uclen; unsigned short port; char buf[515]; int i, len; buf[0] = 0x05; buf[1] = 0x01; buf[2] = 0x00; applog(LOG_DEBUG, "Attempting to negotiate with %s:%s SOCKS5 proxy", pool->sockaddr_proxy_url, pool->sockaddr_proxy_port )...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,350
bool stratum_send(struct pool *pool, char *s, ssize_t len) { enum send_ret ret = SEND_INACTIVE; if (opt_protocol) applog(LOG_DEBUG, "SEND: %s", s); mutex_lock(&pool->stratum_lock); if (pool->stratum_active) ret = __stratum_send(pool, s, len); mutex_unlock(&pool->stratum_lock); /* This is to avoid doing app...
DoS
0
bool stratum_send(struct pool *pool, char *s, ssize_t len) { enum send_ret ret = SEND_INACTIVE; if (opt_protocol) applog(LOG_DEBUG, "SEND: %s", s); mutex_lock(&pool->stratum_lock); if (pool->stratum_active) ret = __stratum_send(pool, s, len); mutex_unlock(&pool->stratum_lock); /* This is to avoid doing app...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,351
bool subscribe_extranonce(struct pool *pool) { json_t *val = NULL, *res_val, *err_val; char s[RBUFSIZE], *sret = NULL; json_error_t err; bool ret = false; sprintf(s, "{\"id\": %d, \"method\": \"mining.extranonce.subscribe\", \"params\": []}", swork_id++); if (!stratum_send(pool, s, strlen(s))) return ret; ...
DoS
0
bool subscribe_extranonce(struct pool *pool) { json_t *val = NULL, *res_val, *err_val; char s[RBUFSIZE], *sret = NULL; json_error_t err; bool ret = false; sprintf(s, "{\"id\": %d, \"method\": \"mining.extranonce.subscribe\", \"params\": []}", swork_id++); if (!stratum_send(pool, s, strlen(s))) return ret; ...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,352
void suspend_stratum(struct pool *pool) { applog(LOG_INFO, "Closing socket for stratum %s", get_pool_name(pool)); mutex_lock(&pool->stratum_lock); __suspend_stratum(pool); mutex_unlock(&pool->stratum_lock); }
DoS
0
void suspend_stratum(struct pool *pool) { applog(LOG_INFO, "Closing socket for stratum %s", get_pool_name(pool)); mutex_lock(&pool->stratum_lock); __suspend_stratum(pool); mutex_unlock(&pool->stratum_lock); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,353
int thr_info_create(struct thr_info *thr, pthread_attr_t *attr, void *(*start) (void *), void *arg) { cgsem_init(&thr->sem); return pthread_create(&thr->pth, attr, start, arg); }
DoS
0
int thr_info_create(struct thr_info *thr, pthread_attr_t *attr, void *(*start) (void *), void *arg) { cgsem_init(&thr->sem); return pthread_create(&thr->pth, attr, start, arg); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,354
bool time_less(struct timeval *a, struct timeval *b) { return timercmp(a, b, <); }
DoS
0
bool time_less(struct timeval *a, struct timeval *b) { return timercmp(a, b, <); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,355
void timeraddspec(struct timespec *a, const struct timespec *b) { a->tv_sec += b->tv_sec; a->tv_nsec += b->tv_nsec; if (a->tv_nsec >= 1000000000) { a->tv_nsec -= 1000000000; a->tv_sec++; } }
DoS
0
void timeraddspec(struct timespec *a, const struct timespec *b) { a->tv_sec += b->tv_sec; a->tv_nsec += b->tv_nsec; if (a->tv_nsec >= 1000000000) { a->tv_nsec -= 1000000000; a->tv_sec++; } }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,356
static void __maybe_unused timersubspec(struct timespec *a, const struct timespec *b) { a->tv_sec -= b->tv_sec; a->tv_nsec -= b->tv_nsec; if (a->tv_nsec < 0) { a->tv_nsec += 1000000000; a->tv_sec--; } }
DoS
0
static void __maybe_unused timersubspec(struct timespec *a, const struct timespec *b) { a->tv_sec -= b->tv_sec; a->tv_nsec -= b->tv_nsec; if (a->tv_nsec < 0) { a->tv_nsec += 1000000000; a->tv_sec--; } }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,357
static int __maybe_unused timespec_to_ms(struct timespec *ts) { return ts->tv_sec * 1000 + ts->tv_nsec / 1000000; }
DoS
0
static int __maybe_unused timespec_to_ms(struct timespec *ts) { return ts->tv_sec * 1000 + ts->tv_nsec / 1000000; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,358
void tq_free(struct thread_q *tq) { struct tq_ent *ent, *iter; if (!tq) return; list_for_each_entry_safe(ent, iter, &tq->q, q_node) { list_del(&ent->q_node); free(ent); } pthread_cond_destroy(&tq->cond); pthread_mutex_destroy(&tq->mutex); memset(tq, 0, sizeof(*tq)); /* poison */ free(tq); }
DoS
0
void tq_free(struct thread_q *tq) { struct tq_ent *ent, *iter; if (!tq) return; list_for_each_entry_safe(ent, iter, &tq->q, q_node) { list_del(&ent->q_node); free(ent); } pthread_cond_destroy(&tq->cond); pthread_mutex_destroy(&tq->mutex); memset(tq, 0, sizeof(*tq)); /* poison */ free(tq); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,359
void tq_freeze(struct thread_q *tq) { tq_freezethaw(tq, true); }
DoS
0
void tq_freeze(struct thread_q *tq) { tq_freezethaw(tq, true); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,360
static void tq_freezethaw(struct thread_q *tq, bool frozen) { mutex_lock(&tq->mutex); tq->frozen = frozen; pthread_cond_signal(&tq->cond); mutex_unlock(&tq->mutex); }
DoS
0
static void tq_freezethaw(struct thread_q *tq, bool frozen) { mutex_lock(&tq->mutex); tq->frozen = frozen; pthread_cond_signal(&tq->cond); mutex_unlock(&tq->mutex); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,361
struct thread_q *tq_new(void) { struct thread_q *tq; tq = (struct thread_q *)calloc(1, sizeof(*tq)); if (!tq) return NULL; INIT_LIST_HEAD(&tq->q); pthread_mutex_init(&tq->mutex, NULL); pthread_cond_init(&tq->cond, NULL); return tq; }
DoS
0
struct thread_q *tq_new(void) { struct thread_q *tq; tq = (struct thread_q *)calloc(1, sizeof(*tq)); if (!tq) return NULL; INIT_LIST_HEAD(&tq->q); pthread_mutex_init(&tq->mutex, NULL); pthread_cond_init(&tq->cond, NULL); return tq; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,362
void tq_thaw(struct thread_q *tq) { tq_freezethaw(tq, false); }
DoS
0
void tq_thaw(struct thread_q *tq) { tq_freezethaw(tq, false); }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,363
static size_t upload_data_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct upload_buffer *ub = (struct upload_buffer *)user_data; unsigned int len = size * nmemb; if (len > ub->len) len = ub->len; if (len) { memcpy(ptr, ub->buf, len); ub->buf = (uint8_t*)ub->buf + len; ub->len -=...
DoS
0
static size_t upload_data_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct upload_buffer *ub = (struct upload_buffer *)user_data; unsigned int len = size * nmemb; if (len > ub->len) len = ub->len; if (len) { memcpy(ptr, ub->buf, len); ub->buf = (uint8_t*)ub->buf + len; ub->len -=...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,364
double us_tdiff(struct timeval *end, struct timeval *start) { /* Sanity check. We should only be using this for small differences so * limit the max to 60 seconds. */ if (unlikely(end->tv_sec - start->tv_sec > 60)) return 60000000; return (end->tv_sec - start->tv_sec) * 1000000 + (end->tv_usec - start->tv_usec);...
DoS
0
double us_tdiff(struct timeval *end, struct timeval *start) { /* Sanity check. We should only be using this for small differences so * limit the max to 60 seconds. */ if (unlikely(end->tv_sec - start->tv_sec > 60)) return 60000000; return (end->tv_sec - start->tv_sec) * 1000000 + (end->tv_usec - start->tv_usec);...
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,365
void us_to_timespec(struct timespec *spec, int64_t us) { lldiv_t tvdiv = lldiv(us, 1000000); spec->tv_sec = tvdiv.quot; spec->tv_nsec = tvdiv.rem * 1000; }
DoS
0
void us_to_timespec(struct timespec *spec, int64_t us) { lldiv_t tvdiv = lldiv(us, 1000000); spec->tv_sec = tvdiv.quot; spec->tv_nsec = tvdiv.rem * 1000; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,366
void us_to_timeval(struct timeval *val, int64_t us) { lldiv_t tvdiv = lldiv(us, 1000000); val->tv_sec = tvdiv.quot; val->tv_usec = tvdiv.rem; }
DoS
0
void us_to_timeval(struct timeval *val, int64_t us) { lldiv_t tvdiv = lldiv(us, 1000000); val->tv_sec = tvdiv.quot; val->tv_usec = tvdiv.rem; }
@@ -1600,24 +1600,31 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.nbit, "00000000", /* nonce */ workpadding); - if (unlikely(!hex2bin(pool->header_bin, header, 128))) - quit(1, "Failed to convert header to header_bin in parse_notify"); + if (unlikely(!hex2bin(pool->header_bin, heade...
CWE-20
null
null
29,367
static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len) { SOCKETTYPE sock = pool->sock; ssize_t ssent = 0; strcat(s, "\n"); len++; while (len > 0 ) { struct timeval timeout = {1, 0}; ssize_t sent; fd_set wd; retry: FD_ZERO(&wd); FD_SET(sock, &wd); if (select(sock + 1, NULL, &wd, ...
Overflow
0
static enum send_ret __stratum_send(struct pool *pool, char *s, ssize_t len) { SOCKETTYPE sock = pool->sock; ssize_t ssent = 0; strcat(s, "\n"); len++; while (len > 0 ) { struct timeval timeout = {1, 0}; ssize_t sent; fd_set wd; retry: FD_ZERO(&wd); FD_SET(sock, &wd); if (select(sock + 1, NULL, &wd, ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,368
void _cg_memcpy(void *dest, const void *src, unsigned int n, const char *file, const char *func, const int line) { if (unlikely(n < 1 || n > (1ul << 31))) { applog(LOG_ERR, "ERR: Asked to memcpy %u bytes from %s %s():%d", n, file, func, line); return; } memcpy(dest, src, n); }
Overflow
0
void _cg_memcpy(void *dest, const void *src, unsigned int n, const char *file, const char *func, const int line) { if (unlikely(n < 1 || n > (1ul << 31))) { applog(LOG_ERR, "ERR: Asked to memcpy %u bytes from %s %s():%d", n, file, func, line); return; } memcpy(dest, src, n); }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,369
void _recalloc(void **ptr, size_t old, size_t new, const char *file, const char *func, const int line) { if (new == old) return; *ptr = realloc(*ptr, new); if (unlikely(!*ptr)) quitfrom(1, file, func, line, "Failed to realloc"); if (new > old) memset(*ptr + old, 0, new - old); }
Overflow
0
void _recalloc(void **ptr, size_t old, size_t new, const char *file, const char *func, const int line) { if (new == old) return; *ptr = realloc(*ptr, new); if (unlikely(!*ptr)) quitfrom(1, file, func, line, "Failed to realloc"); if (new > old) memset(*ptr + old, 0, new - old); }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,370
void address_to_pubkeyhash(unsigned char *pkh, const char *addr) { unsigned char b58bin[25]; memset(b58bin, 0, 25); b58tobin(b58bin, addr); pkh[0] = 0x76; pkh[1] = 0xa9; pkh[2] = 0x14; memcpy(&pkh[3], &b58bin[1], 20); pkh[23] = 0x88; pkh[24] = 0xac; }
Overflow
0
void address_to_pubkeyhash(unsigned char *pkh, const char *addr) { unsigned char b58bin[25]; memset(b58bin, 0, 25); b58tobin(b58bin, addr); pkh[0] = 0x76; pkh[1] = 0xa9; pkh[2] = 0x14; memcpy(&pkh[3], &b58bin[1], 20); pkh[23] = 0x88; pkh[24] = 0xac; }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,371
static size_t all_data_cb(const void *ptr, size_t size, size_t nmemb, void *user_data) { struct data_buffer *db = user_data; size_t len = size * nmemb; size_t oldlen, newlen; void *newmem; static const unsigned char zero = 0; oldlen = db->len; newlen = oldlen + len; newmem = realloc(db->buf, newlen + 1);...
Overflow
0
static size_t all_data_cb(const void *ptr, size_t size, size_t nmemb, void *user_data) { struct data_buffer *db = user_data; size_t len = size * nmemb; size_t oldlen, newlen; void *newmem; static const unsigned char zero = 0; oldlen = db->len; newlen = oldlen + len; newmem = realloc(db->buf, newlen + 1);...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,372
bool auth_stratum(struct pool *pool) { json_t *val = NULL, *res_val, *err_val; char s[RBUFSIZE], *sret = NULL; json_error_t err; bool ret = false; sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}", swork_id++, pool->rpc_user, pool->rpc_pass); if (!stratum_send(pool, s, ...
Overflow
0
bool auth_stratum(struct pool *pool) { json_t *val = NULL, *res_val, *err_val; char s[RBUFSIZE], *sret = NULL; json_error_t err; bool ret = false; sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}", swork_id++, pool->rpc_user, pool->rpc_pass); if (!stratum_send(pool, s, ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,373
void b58tobin(unsigned char *b58bin, const char *b58) { uint32_t c, bin32[7]; int len, i, j; uint64_t t; memset(bin32, 0, 7 * sizeof(uint32_t)); len = strlen(b58); for (i = 0; i < len; i++) { c = b58[i]; c = b58tobin_tbl[c]; for (j = 6; j >= 0; j--) { t = ((uint64_t)bin32[j]) * 58 + c; c = (t & 0x3f0...
Overflow
0
void b58tobin(unsigned char *b58bin, const char *b58) { uint32_t c, bin32[7]; int len, i, j; uint64_t t; memset(bin32, 0, 7 * sizeof(uint32_t)); len = strlen(b58); for (i = 0; i < len; i++) { c = b58[i]; c = b58tobin_tbl[c]; for (j = 6; j >= 0; j--) { t = ((uint64_t)bin32[j]) * 58 + c; c = (t & 0x3f0...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,374
bool cg_completion_timeout(void *fn, void *fnarg, int timeout) { struct cg_completion *cgc; pthread_t pthread; bool ret = false; cgc = malloc(sizeof(struct cg_completion)); if (unlikely(!cgc)) return ret; cgsem_init(&cgc->cgsem); cgc->fn = fn; cgc->fnarg = fnarg; pthread_create(&pthread, NULL, completion_t...
Overflow
0
bool cg_completion_timeout(void *fn, void *fnarg, int timeout) { struct cg_completion *cgc; pthread_t pthread; bool ret = false; cgc = malloc(sizeof(struct cg_completion)); if (unlikely(!cgc)) return ret; cgsem_init(&cgc->cgsem); cgc->fn = fn; cgc->fnarg = fnarg; pthread_create(&pthread, NULL, completion_t...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,375
char *get_proxy(char *url, struct pool *pool) { pool->rpc_proxy = NULL; char *split; int plen, len, i; for (i = 0; proxynames[i].name; i++) { plen = strlen(proxynames[i].name); if (strncmp(url, proxynames[i].name, plen) == 0) { if (!(split = strchr(url, '|'))) return url; *split = '\0'; len = sp...
Overflow
0
char *get_proxy(char *url, struct pool *pool) { pool->rpc_proxy = NULL; char *split; int plen, len, i; for (i = 0; proxynames[i].name; i++) { plen = strlen(proxynames[i].name); if (strncmp(url, proxynames[i].name, plen) == 0) { if (!(split = strchr(url, '|'))) return url; *split = '\0'; len = sp...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,376
bool hex2bin(unsigned char *p, const char *hexstr, size_t len) { int nibble1, nibble2; unsigned char idx; bool ret = false; while (*hexstr && len) { if (unlikely(!hexstr[1])) { applog(LOG_ERR, "hex2bin str truncated"); return ret; } idx = *hexstr++; nibble1 = hex2bin_tbl[idx]; idx = *hexstr++; n...
Overflow
0
bool hex2bin(unsigned char *p, const char *hexstr, size_t len) { int nibble1, nibble2; unsigned char idx; bool ret = false; while (*hexstr && len) { if (unlikely(!hexstr[1])) { applog(LOG_ERR, "hex2bin str truncated"); return ret; } idx = *hexstr++; nibble1 = hex2bin_tbl[idx]; idx = *hexstr++; n...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,377
json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass, const char *rpc_req, bool probe, bool longpoll, int *rolltime, struct pool *pool, bool share) { long timeout = longpoll ? (60 * 60) : 60; struct data_buffer all_data = {NULL, 0}; struct header_info hi = {NULL, 0, NULL, N...
Overflow
0
json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass, const char *rpc_req, bool probe, bool longpoll, int *rolltime, struct pool *pool, bool share) { long timeout = longpoll ? (60 * 60) : 60; struct data_buffer all_data = {NULL, 0}; struct header_info hi = {NULL, 0, NULL, N...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,378
json_t *json_web_config(const char *url) { struct data_buffer all_data = {NULL, 0}; char curl_err_str[CURL_ERROR_SIZE]; long timeout = 60; json_error_t err; json_t *val; CURL *curl; int rc; memset(&err, 0, sizeof(err)); curl = curl_easy_init(); if (unlikely(!curl)) quithere(1, "CURL initialisation failed"...
Overflow
0
json_t *json_web_config(const char *url) { struct data_buffer all_data = {NULL, 0}; char curl_err_str[CURL_ERROR_SIZE]; long timeout = 60; json_error_t err; json_t *val; CURL *curl; int rc; memset(&err, 0, sizeof(err)); curl = curl_easy_init(); if (unlikely(!curl)) quithere(1, "CURL initialisation failed"...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,379
static void keep_sockalive(SOCKETTYPE fd) { const int tcp_one = 1; #ifndef WIN32 const int tcp_keepidle = 45; const int tcp_keepintvl = 30; int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif setsockopt(fd, SOL_SOCKET, SO...
Overflow
0
static void keep_sockalive(SOCKETTYPE fd) { const int tcp_one = 1; #ifndef WIN32 const int tcp_keepidle = 45; const int tcp_keepintvl = 30; int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, O_NONBLOCK | flags); #else u_long flags = 1; ioctlsocket(fd, FIONBIO, &flags); #endif setsockopt(fd, SOL_SOCKET, SO...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,380
static bool parse_diff(struct pool *pool, json_t *val) { double old_diff, diff; diff = json_number_value(json_array_get(val, 0)); if (diff == 0) return false; cg_wlock(&pool->data_lock); old_diff = pool->sdiff; pool->sdiff = diff; cg_wunlock(&pool->data_lock); if (old_diff != diff) { int idiff = diff; ...
Overflow
0
static bool parse_diff(struct pool *pool, json_t *val) { double old_diff, diff; diff = json_number_value(json_array_get(val, 0)); if (diff == 0) return false; cg_wlock(&pool->data_lock); old_diff = pool->sdiff; pool->sdiff = diff; cg_wunlock(&pool->data_lock); if (old_diff != diff) { int idiff = diff; ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,381
static void recalloc_sock(struct pool *pool, size_t len) { size_t old, new; old = strlen(pool->sockbuf); new = old + len + 1; if (new < pool->sockbuf_size) return; new = new + (RBUFSIZE - (new % RBUFSIZE)); pool->sockbuf = realloc(pool->sockbuf, new); if (!pool->sockbuf) quithere(1, "Failed to realloc pool ...
Overflow
0
static void recalloc_sock(struct pool *pool, size_t len) { size_t old, new; old = strlen(pool->sockbuf); new = old + len + 1; if (new < pool->sockbuf_size) return; new = new + (RBUFSIZE - (new % RBUFSIZE)); pool->sockbuf = realloc(pool->sockbuf, new); if (!pool->sockbuf) quithere(1, "Failed to realloc pool ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,382
char *recv_line(struct pool *pool) { char *tok, *sret = NULL; ssize_t len, buflen; int waited = 0; if (!strstr(pool->sockbuf, "\n")) { struct timeval rstart, now; cgtime(&rstart); if (!socket_full(pool, DEFAULT_SOCKWAIT)) { applog(LOG_DEBUG, "Timed out waiting for data on socket_full"); goto out; } ...
Overflow
0
char *recv_line(struct pool *pool) { char *tok, *sret = NULL; ssize_t len, buflen; int waited = 0; if (!strstr(pool->sockbuf, "\n")) { struct timeval rstart, now; cgtime(&rstart); if (!socket_full(pool, DEFAULT_SOCKWAIT)) { applog(LOG_DEBUG, "Timed out waiting for data on socket_full"); goto out; } ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,383
bool restart_stratum(struct pool *pool) { if (pool->stratum_active) suspend_stratum(pool); if (!initiate_stratum(pool)) return false; if (!auth_stratum(pool)) return false; return true; }
Overflow
0
bool restart_stratum(struct pool *pool) { if (pool->stratum_active) suspend_stratum(pool); if (!initiate_stratum(pool)) return false; if (!auth_stratum(pool)) return false; return true; }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,384
unsigned char *ser_string(char *s, int *slen) { size_t len = strlen(s); unsigned char *ret; ret = malloc(1 + len + 8); // Leave room for largest size if (unlikely(!ret)) quit(1, "Failed to malloc ret in ser_string"); if (len < 253) { ret[0] = len; memcpy(ret + 1, s, len); *slen = len + 1; } else if (len ...
Overflow
0
unsigned char *ser_string(char *s, int *slen) { size_t len = strlen(s); unsigned char *ret; ret = malloc(1 + len + 8); // Leave room for largest size if (unlikely(!ret)) quit(1, "Failed to malloc ret in ser_string"); if (len < 253) { ret[0] = len; memcpy(ret + 1, s, len); *slen = len + 1; } else if (len ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,385
static bool setup_stratum_socket(struct pool *pool) { struct addrinfo servinfobase, *servinfo, *hints, *p; char *sockaddr_url, *sockaddr_port; int sockd; mutex_lock(&pool->stratum_lock); pool->stratum_active = false; if (pool->sock) CLOSESOCKET(pool->sock); pool->sock = 0; mutex_unlock(&pool->stratum_lock); ...
Overflow
0
static bool setup_stratum_socket(struct pool *pool) { struct addrinfo servinfobase, *servinfo, *hints, *p; char *sockaddr_url, *sockaddr_port; int sockd; mutex_lock(&pool->stratum_lock); pool->stratum_active = false; if (pool->sock) CLOSESOCKET(pool->sock); pool->sock = 0; mutex_unlock(&pool->stratum_lock); ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,386
static bool show_message(struct pool *pool, json_t *val) { char *msg; if (!json_is_array(val)) return false; msg = (char *)json_string_value(json_array_get(val, 0)); if (!msg) return false; applog(LOG_NOTICE, "Pool %d message: %s", pool->pool_no, msg); return true; }
Overflow
0
static bool show_message(struct pool *pool, json_t *val) { char *msg; if (!json_is_array(val)) return false; msg = (char *)json_string_value(json_array_get(val, 0)); if (!msg) return false; applog(LOG_NOTICE, "Pool %d message: %s", pool->pool_no, msg); return true; }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,387
static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a) { unsigned short port; in_addr_t inp; char buf[515]; int i, len; buf[0] = 0x04; buf[1] = 0x01; port = atoi(pool->stratum_port); buf[2] = port >> 8; buf[3] = port & 0xff; sprintf(&buf[8], "CGMINER"); /* See if we've been given an IP ad...
Overflow
0
static bool socks4_negotiate(struct pool *pool, int sockd, bool socks4a) { unsigned short port; in_addr_t inp; char buf[515]; int i, len; buf[0] = 0x04; buf[1] = 0x01; port = atoi(pool->stratum_port); buf[2] = port >> 8; buf[3] = port & 0xff; sprintf(&buf[8], "CGMINER"); /* See if we've been given an IP ad...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,388
bool stratum_send(struct pool *pool, char *s, ssize_t len) { enum send_ret ret = SEND_INACTIVE; if (opt_protocol) applog(LOG_DEBUG, "SEND: %s", s); mutex_lock(&pool->stratum_lock); if (pool->stratum_active) ret = __stratum_send(pool, s, len); mutex_unlock(&pool->stratum_lock); /* This is to avoid doing app...
Overflow
0
bool stratum_send(struct pool *pool, char *s, ssize_t len) { enum send_ret ret = SEND_INACTIVE; if (opt_protocol) applog(LOG_DEBUG, "SEND: %s", s); mutex_lock(&pool->stratum_lock); if (pool->stratum_active) ret = __stratum_send(pool, s, len); mutex_unlock(&pool->stratum_lock); /* This is to avoid doing app...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,389
void suspend_stratum(struct pool *pool) { applog(LOG_INFO, "Closing socket for stratum pool %d", pool->pool_no); mutex_lock(&pool->stratum_lock); __suspend_stratum(pool); mutex_unlock(&pool->stratum_lock); }
Overflow
0
void suspend_stratum(struct pool *pool) { applog(LOG_INFO, "Closing socket for stratum pool %d", pool->pool_no); mutex_lock(&pool->stratum_lock); __suspend_stratum(pool); mutex_unlock(&pool->stratum_lock); }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,390
void *tq_pop(struct thread_q *tq, const struct timespec *abstime) { struct tq_ent *ent; void *rval = NULL; int rc; mutex_lock(&tq->mutex); if (!list_empty(&tq->q)) goto pop; if (abstime) rc = pthread_cond_timedwait(&tq->cond, &tq->mutex, abstime); else rc = pthread_cond_wait(&tq->cond, &tq->mutex); if (...
Overflow
0
void *tq_pop(struct thread_q *tq, const struct timespec *abstime) { struct tq_ent *ent; void *rval = NULL; int rc; mutex_lock(&tq->mutex); if (!list_empty(&tq->q)) goto pop; if (abstime) rc = pthread_cond_timedwait(&tq->cond, &tq->mutex, abstime); else rc = pthread_cond_wait(&tq->cond, &tq->mutex); if (...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,391
bool tq_push(struct thread_q *tq, void *data) { struct tq_ent *ent; bool rc = true; ent = calloc(1, sizeof(*ent)); if (!ent) return false; ent->data = data; INIT_LIST_HEAD(&ent->q_node); mutex_lock(&tq->mutex); if (!tq->frozen) { list_add_tail(&ent->q_node, &tq->q); } else { free(ent); rc = false; ...
Overflow
0
bool tq_push(struct thread_q *tq, void *data) { struct tq_ent *ent; bool rc = true; ent = calloc(1, sizeof(*ent)); if (!ent) return false; ent->data = data; INIT_LIST_HEAD(&ent->q_node); mutex_lock(&tq->mutex); if (!tq->frozen) { list_add_tail(&ent->q_node, &tq->q); } else { free(ent); rc = false; ...
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,392
static size_t upload_data_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct upload_buffer *ub = user_data; unsigned int len = size * nmemb; if (len > ub->len) len = ub->len; if (len) { memcpy(ptr, ub->buf, len); ub->buf += len; ub->len -= len; } return len; }
Overflow
0
static size_t upload_data_cb(void *ptr, size_t size, size_t nmemb, void *user_data) { struct upload_buffer *ub = user_data; unsigned int len = size * nmemb; if (len > ub->len) len = ub->len; if (len) { memcpy(ptr, ub->buf, len); ub->buf += len; ub->len -= len; } return len; }
@@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Con Kolivas + * Copyright 2011-2014 Con Kolivas * Copyright 2010 Jeff Garzik * * This program is free software; you can redistribute it and/or modify it @@ -720,6 +720,34 @@ bool hex2bin(unsigned char *p, const char *hexstr, size_t len) return ret; } +static bool _...
CWE-119
null
null
29,393
static bool parse_notify(struct pool *pool, json_t *val) { char *job_id, *prev_hash, *coinbase1, *coinbase2, *bbversion, *nbit, *ntime, *header; size_t cb1_len, cb2_len, alloc_len; unsigned char *cb1, *cb2; bool clean, ret = false; int merkles, i; json_t *arr; arr = json_array_get(val, 4); if (!arr || !j...
Overflow
0
static bool parse_notify(struct pool *pool, json_t *val) { char *job_id, *prev_hash, *coinbase1, *coinbase2, *bbversion, *nbit, *ntime, *header; size_t cb1_len, cb2_len, alloc_len; unsigned char *cb1, *cb2; bool clean, ret = false; int merkles, i; json_t *arr; arr = json_array_get(val, 4); if (!arr || !j...
@@ -1219,6 +1219,13 @@ bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port) if (url_len < 1) return false; + + if (url_len >= sizeof(url_address)) + { + applog(LOG_WARNING, "%s: Truncating overflowed address '%.*s'", + __func__, url_len, url_begin); + url_len = sizeof(url_addres...
CWE-119
null
null
29,394
krb5_decode_krbsecretkey(krb5_context context, krb5_db_entry *entries, struct berval **bvalues, krb5_tl_data *userinfo_tl_data, krb5_kvno *mkvno) { char *user=NULL; int i=0, j=0, noofkeys=0; krb5_key_data ...
DoS Exec Code Overflow
0
krb5_decode_krbsecretkey(krb5_context context, krb5_db_entry *entries, struct berval **bvalues, krb5_tl_data *userinfo_tl_data, krb5_kvno *mkvno) { char *user=NULL; int i=0, j=0, noofkeys=0; krb5_key_data ...
@@ -463,7 +463,8 @@ krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, j++; last = i + 1; - currkvno = key_data[i].key_data_kvno; + if (i < n_key_data - 1) + currkvno = key_data[i + 1].key_data_kvno; } } ret[num_versio...
CWE-189
null
null
29,395
krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, unsigned int flags, krb5_db_entry **entry_ptr) { char *user=NULL, *filter=NULL, *filtuser=NULL; unsigned int tree=0, ntrees=1, princlen=0; krb5_error_code t...
DoS Exec Code Overflow
0
krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, unsigned int flags, krb5_db_entry **entry_ptr) { char *user=NULL, *filter=NULL, *filtuser=NULL; unsigned int tree=0, ntrees=1, princlen=0; krb5_error_code t...
@@ -463,7 +463,8 @@ krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, j++; last = i + 1; - currkvno = key_data[i].key_data_kvno; + if (i < n_key_data - 1) + currkvno = key_data[i + 1].key_data_kvno; } } ret[num_versio...
CWE-189
null
null
29,396
krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry, char **db_args) { int l=0, kerberos_principal_object_type=0; unsigned int ntrees=0, tre=0; krb5_error_code st=0, tempst=0; LDAP *ld=NULL; ...
DoS Exec Code Overflow
0
krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry, char **db_args) { int l=0, kerberos_principal_object_type=0; unsigned int ntrees=0, tre=0; krb5_error_code st=0, tempst=0; LDAP *ld=NULL; ...
@@ -463,7 +463,8 @@ krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, j++; last = i + 1; - currkvno = key_data[i].key_data_kvno; + if (i < n_key_data - 1) + currkvno = key_data[i + 1].key_data_kvno; } } ret[num_versio...
CWE-189
null
null
29,397
krb5_read_tkt_policy(krb5_context context, krb5_ldap_context *ldap_context, krb5_db_entry *entries, char *policy) { krb5_error_code st=0; int mask=0, omask=0; int tkt_mask=(KDB_MAX_LIFE_ATTR | KDB_MAX_RLIFE_ATTR | KDB_TKT_FLAGS...
DoS Exec Code Overflow
0
krb5_read_tkt_policy(krb5_context context, krb5_ldap_context *ldap_context, krb5_db_entry *entries, char *policy) { krb5_error_code st=0; int mask=0, omask=0; int tkt_mask=(KDB_MAX_LIFE_ATTR | KDB_MAX_RLIFE_ATTR | KDB_TKT_FLAGS...
@@ -463,7 +463,8 @@ krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, j++; last = i + 1; - currkvno = key_data[i].key_data_kvno; + if (i < n_key_data - 1) + currkvno = key_data[i + 1].key_data_kvno; } } ret[num_versio...
CWE-189
null
null
29,398
process_db_args(krb5_context context, char **db_args, xargs_t *xargs, OPERATION optype) { int i=0; krb5_error_code st=0; char *arg=NULL, *arg_val=NULL; char **dptr=NULL; unsigned int arg_val_len=0; if (db_args) {...
DoS Exec Code Overflow
0
process_db_args(krb5_context context, char **db_args, xargs_t *xargs, OPERATION optype) { int i=0; krb5_error_code st=0; char *arg=NULL, *arg_val=NULL; char **dptr=NULL; unsigned int arg_val_len=0; if (db_args) {...
@@ -463,7 +463,8 @@ krb5_encode_krbsecretkey(krb5_key_data *key_data_in, int n_key_data, j++; last = i + 1; - currkvno = key_data[i].key_data_kvno; + if (i < n_key_data - 1) + currkvno = key_data[i + 1].key_data_kvno; } } ret[num_versio...
CWE-189
null
null
29,399
acc_ctx_call_acc(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc, spnego_gss_cred_id_t spcred, gss_buffer_t mechtok_in, gss_OID *mech_type, gss_buffer_t mechtok_out, OM_uint32 *ret_flags, OM_uint32 *time_rec, gss_cred_id_t *delegated_cred_handle, OM_uint32 *negState, send_token_flag *tokflag) { OM_uint3...
DoS
0
acc_ctx_call_acc(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc, spnego_gss_cred_id_t spcred, gss_buffer_t mechtok_in, gss_OID *mech_type, gss_buffer_t mechtok_out, OM_uint32 *ret_flags, OM_uint32 *time_rec, gss_cred_id_t *delegated_cred_handle, OM_uint32 *negState, send_token_flag *tokflag) { OM_uint3...
@@ -1442,7 +1442,7 @@ acc_ctx_cont(OM_uint32 *minstat, ptr = bufstart = buf->value; #define REMAIN (buf->length - (ptr - bufstart)) - if (REMAIN > INT_MAX) + if (REMAIN == 0 || REMAIN > INT_MAX) return GSS_S_DEFECTIVE_TOKEN; /*
CWE-476
null
null