idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
14,600
void servers_init(void) { settings_add_bool("server", "resolve_prefer_ipv6", FALSE); settings_add_bool("server", "resolve_reverse_lookup", FALSE); lookup_servers = servers = NULL; signal_add("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit); servers_reconnect_init(); servers_setup_init(); }
null
0
void servers_init(void) { settings_add_bool("server", "resolve_prefer_ipv6", FALSE); settings_add_bool("server", "resolve_reverse_lookup", FALSE); lookup_servers = servers = NULL; signal_add("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit); servers_reconnect_init(); servers_setup_init(); }
@@ -224,7 +224,7 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip, port = server->connrec->proxy != NULL ? server->connrec->proxy_port : server->connrec->port; handle = server->connrec->use_ssl ? - net_connect_ip_ssl(ip, port, own_ip, server->connrec->ssl_cert, server->connrec->ssl_pkey, + ...
CWE-20
null
null
14,601
static void sig_chat_protocol_deinit(CHAT_PROTOCOL_REC *proto) { disconnect_servers(servers, proto->id); disconnect_servers(lookup_servers, proto->id); }
null
0
static void sig_chat_protocol_deinit(CHAT_PROTOCOL_REC *proto) { disconnect_servers(servers, proto->id); disconnect_servers(lookup_servers, proto->id); }
@@ -224,7 +224,7 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip, port = server->connrec->proxy != NULL ? server->connrec->proxy_port : server->connrec->port; handle = server->connrec->use_ssl ? - net_connect_ip_ssl(ip, port, own_ip, server->connrec->ssl_cert, server->connrec->ssl_pkey, + ...
CWE-20
null
null
14,602
static void add_bin_header(conn *c, uint16_t err, uint8_t hdr_len, uint16_t key_len, uint32_t body_len) { protocol_binary_response_header* header; assert(c); c->msgcurr = 0; c->msgused = 0; c->iovused = 0; if (add_msghdr(c) != 0) { /* XXX: out_string is inappropriate here */ o...
DoS
0
static void add_bin_header(conn *c, uint16_t err, uint8_t hdr_len, uint16_t key_len, uint32_t body_len) { protocol_binary_response_header* header; assert(c); c->msgcurr = 0; c->msgused = 0; c->iovused = 0; if (add_msghdr(c) != 0) { /* XXX: out_string is inappropriate here */ o...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,603
static int add_iov(conn *c, const void *buf, int len) { struct msghdr *m; int leftover; bool limit_to_mtu; assert(c != NULL); do { m = &c->msglist[c->msgused - 1]; /* * Limit UDP packets, and the first payloads of TCP replies, to * UDP_MAX_PAYLOAD_SIZE bytes. ...
DoS
0
static int add_iov(conn *c, const void *buf, int len) { struct msghdr *m; int leftover; bool limit_to_mtu; assert(c != NULL); do { m = &c->msglist[c->msgused - 1]; /* * Limit UDP packets, and the first payloads of TCP replies, to * UDP_MAX_PAYLOAD_SIZE bytes. ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,604
static int add_msghdr(conn *c) { struct msghdr *msg; assert(c != NULL); if (c->msgsize == c->msgused) { msg = realloc(c->msglist, c->msgsize * 2 * sizeof(struct msghdr)); if (! msg) return -1; c->msglist = msg; c->msgsize *= 2; } msg = c->msglist + c->m...
DoS
0
static int add_msghdr(conn *c) { struct msghdr *msg; assert(c != NULL); if (c->msgsize == c->msgused) { msg = realloc(c->msglist, c->msgsize * 2 * sizeof(struct msghdr)); if (! msg) return -1; c->msglist = msg; c->msgsize *= 2; } msg = c->msglist + c->m...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,605
static void append_ascii_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, conn *c) { char *pos = c->stats.buffer + c->stats.offset; uint32_t nbytes = 0; int remaining = c->stats.size - c->stats.offset; int roo...
DoS
0
static void append_ascii_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, conn *c) { char *pos = c->stats.buffer + c->stats.offset; uint32_t nbytes = 0; int remaining = c->stats.size - c->stats.offset; int roo...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,606
static void append_bin_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, conn *c) { char *buf = c->stats.buffer + c->stats.offset; uint32_t bodylen = klen + vlen; protocol_binary_response_header header = { .res...
DoS
0
static void append_bin_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, conn *c) { char *buf = c->stats.buffer + c->stats.offset; uint32_t bodylen = klen + vlen; protocol_binary_response_header header = { .res...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,607
void append_stat(const char *name, ADD_STAT add_stats, conn *c, const char *fmt, ...) { char val_str[STAT_VAL_LEN]; int vlen; va_list ap; assert(name); assert(add_stats); assert(c); assert(fmt); va_start(ap, fmt); vlen = vsnprintf(val_str, sizeof(val_str) - 1, fmt,...
DoS
0
void append_stat(const char *name, ADD_STAT add_stats, conn *c, const char *fmt, ...) { char val_str[STAT_VAL_LEN]; int vlen; va_list ap; assert(name); assert(add_stats); assert(c); assert(fmt); va_start(ap, fmt); vlen = vsnprintf(val_str, sizeof(val_str) - 1, fmt,...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,608
static void append_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie) { /* value without a key is invalid */ if (klen == 0 && vlen > 0) { return ; } conn *c = (conn*)cookie; if (c->protocol == binary_pro...
DoS
0
static void append_stats(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie) { /* value without a key is invalid */ if (klen == 0 && vlen > 0) { return ; } conn *c = (conn*)cookie; if (c->protocol == binary_pro...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,609
static void* binary_get_request(conn *c) { char *ret = c->rcurr; ret -= (sizeof(c->binary_header) + c->binary_header.request.keylen + c->binary_header.request.extlen); assert(ret >= c->rbuf); return ret; }
DoS
0
static void* binary_get_request(conn *c) { char *ret = c->rcurr; ret -= (sizeof(c->binary_header) + c->binary_header.request.keylen + c->binary_header.request.extlen); assert(ret >= c->rbuf); return ret; }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,610
static void clock_handler(const int fd, const short which, void *arg) { struct timeval t = {.tv_sec = 1, .tv_usec = 0}; static bool initialized = false; if (initialized) { /* only delete the event if it's actually there. */ evtimer_del(&clockevent); } else { initialized = true; ...
DoS
0
static void clock_handler(const int fd, const short which, void *arg) { struct timeval t = {.tv_sec = 1, .tv_usec = 0}; static bool initialized = false; if (initialized) { /* only delete the event if it's actually there. */ evtimer_del(&clockevent); } else { initialized = true; ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,611
static void complete_incr_bin(conn *c) { item *it; char *key; size_t nkey; protocol_binary_response_incr* rsp = (protocol_binary_response_incr*)c->wbuf; protocol_binary_request_incr* req = binary_get_request(c); assert(c != NULL); assert(c->wsize >= sizeof(*rsp)); /* fix byteorder in ...
DoS
0
static void complete_incr_bin(conn *c) { item *it; char *key; size_t nkey; protocol_binary_response_incr* rsp = (protocol_binary_response_incr*)c->wbuf; protocol_binary_request_incr* req = binary_get_request(c); assert(c != NULL); assert(c->wsize >= sizeof(*rsp)); /* fix byteorder in ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,612
static void complete_nread(conn *c) { assert(c != NULL); assert(c->protocol == ascii_prot || c->protocol == binary_prot); if (c->protocol == ascii_prot) { complete_nread_ascii(c); } else if (c->protocol == binary_prot) { complete_nread_binary(c); } }
DoS
0
static void complete_nread(conn *c) { assert(c != NULL); assert(c->protocol == ascii_prot || c->protocol == binary_prot); if (c->protocol == ascii_prot) { complete_nread_ascii(c); } else if (c->protocol == binary_prot) { complete_nread_binary(c); } }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,613
static void complete_nread_ascii(conn *c) { assert(c != NULL); item *it = c->item; int comm = c->cmd; enum store_item_type ret; pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); if (strn...
DoS
0
static void complete_nread_ascii(conn *c) { assert(c != NULL); item *it = c->item; int comm = c->cmd; enum store_item_type ret; pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); if (strn...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,614
static void complete_nread_binary(conn *c) { assert(c != NULL); assert(c->cmd >= 0); switch(c->substate) { case bin_reading_set_header: if (c->cmd == PROTOCOL_BINARY_CMD_APPEND || c->cmd == PROTOCOL_BINARY_CMD_PREPEND) { process_bin_append_prepend(c); } else ...
DoS
0
static void complete_nread_binary(conn *c) { assert(c != NULL); assert(c->cmd >= 0); switch(c->substate) { case bin_reading_set_header: if (c->cmd == PROTOCOL_BINARY_CMD_APPEND || c->cmd == PROTOCOL_BINARY_CMD_PREPEND) { process_bin_append_prepend(c); } else ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,615
static void complete_update_bin(conn *c) { protocol_binary_response_status eno = PROTOCOL_BINARY_RESPONSE_EINVAL; enum store_item_type ret = NOT_STORED; assert(c != NULL); item *it = c->item; pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++; ...
DoS
0
static void complete_update_bin(conn *c) { protocol_binary_response_status eno = PROTOCOL_BINARY_RESPONSE_EINVAL; enum store_item_type ret = NOT_STORED; assert(c != NULL); item *it = c->item; pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++; ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,616
bool conn_add_to_freelist(conn *c) { bool ret = true; pthread_mutex_lock(&conn_lock); if (freecurr < freetotal) { freeconns[freecurr++] = c; ret = false; } else { /* try to enlarge free connections array */ size_t newsize = freetotal * 2; conn **new_freeconns = re...
DoS
0
bool conn_add_to_freelist(conn *c) { bool ret = true; pthread_mutex_lock(&conn_lock); if (freecurr < freetotal) { freeconns[freecurr++] = c; ret = false; } else { /* try to enlarge free connections array */ size_t newsize = freetotal * 2; conn **new_freeconns = re...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,617
static void conn_cleanup(conn *c) { assert(c != NULL); if (c->item) { item_remove(c->item); c->item = 0; } if (c->ileft != 0) { for (; c->ileft > 0; c->ileft--,c->icurr++) { item_remove(*(c->icurr)); } } if (c->suffixleft != 0) { for (; c->s...
DoS
0
static void conn_cleanup(conn *c) { assert(c != NULL); if (c->item) { item_remove(c->item); c->item = 0; } if (c->ileft != 0) { for (; c->ileft > 0; c->ileft--,c->icurr++) { item_remove(*(c->icurr)); } } if (c->suffixleft != 0) { for (; c->s...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,618
static void conn_close(conn *c) { assert(c != NULL); /* delete the event, the socket and the conn */ event_del(&c->event); if (settings.verbose > 1) fprintf(stderr, "<%d connection closed.\n", c->sfd); MEMCACHED_CONN_RELEASE(c->sfd); close(c->sfd); accept_new_conns(true); conn...
DoS
0
static void conn_close(conn *c) { assert(c != NULL); /* delete the event, the socket and the conn */ event_del(&c->event); if (settings.verbose > 1) fprintf(stderr, "<%d connection closed.\n", c->sfd); MEMCACHED_CONN_RELEASE(c->sfd); close(c->sfd); accept_new_conns(true); conn...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,619
conn *conn_from_freelist() { conn *c; pthread_mutex_lock(&conn_lock); if (freecurr > 0) { c = freeconns[--freecurr]; } else { c = NULL; } pthread_mutex_unlock(&conn_lock); return c; }
DoS
0
conn *conn_from_freelist() { conn *c; pthread_mutex_lock(&conn_lock); if (freecurr > 0) { c = freeconns[--freecurr]; } else { c = NULL; } pthread_mutex_unlock(&conn_lock); return c; }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,620
conn *conn_new(const int sfd, enum conn_states init_state, const int event_flags, const int read_buffer_size, enum network_transport transport, struct event_base *base) { conn *c = conn_from_freelist(); if (NULL == c) { if (!(c = (conn *)calloc(1, sizeof(...
DoS
0
conn *conn_new(const int sfd, enum conn_states init_state, const int event_flags, const int read_buffer_size, enum network_transport transport, struct event_base *base) { conn *c = conn_from_freelist(); if (NULL == c) { if (!(c = (conn *)calloc(1, sizeof(...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,621
static void conn_set_state(conn *c, enum conn_states state) { assert(c != NULL); assert(state >= conn_listening && state < conn_max_state); if (state != c->state) { if (settings.verbose > 2) { fprintf(stderr, "%d: going from %s to %s\n", c->sfd, state_text(c->state),...
DoS
0
static void conn_set_state(conn *c, enum conn_states state) { assert(c != NULL); assert(state >= conn_listening && state < conn_max_state); if (state != c->state) { if (settings.verbose > 2) { fprintf(stderr, "%d: going from %s to %s\n", c->sfd, state_text(c->state),...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,622
static void conn_shrink(conn *c) { assert(c != NULL); if (IS_UDP(c->transport)) return; if (c->rsize > READ_BUFFER_HIGHWAT && c->rbytes < DATA_BUFFER_SIZE) { char *newbuf; if (c->rcurr != c->rbuf) memmove(c->rbuf, c->rcurr, (size_t)c->rbytes); newbuf = (char *...
DoS
0
static void conn_shrink(conn *c) { assert(c != NULL); if (IS_UDP(c->transport)) return; if (c->rsize > READ_BUFFER_HIGHWAT && c->rbytes < DATA_BUFFER_SIZE) { char *newbuf; if (c->rcurr != c->rbuf) memmove(c->rbuf, c->rcurr, (size_t)c->rbytes); newbuf = (char *...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,623
static void dispatch_bin_command(conn *c) { int protocol_error = 0; int extlen = c->binary_header.request.extlen; int keylen = c->binary_header.request.keylen; uint32_t bodylen = c->binary_header.request.bodylen; if (settings.sasl && !authenticated(c)) { write_bin_error(c, PROTOCOL_BINARY_...
DoS
0
static void dispatch_bin_command(conn *c) { int protocol_error = 0; int extlen = c->binary_header.request.extlen; int keylen = c->binary_header.request.keylen; uint32_t bodylen = c->binary_header.request.bodylen; if (settings.sasl && !authenticated(c)) { write_bin_error(c, PROTOCOL_BINARY_...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,624
void do_accept_new_conns(const bool do_accept) { conn *next; for (next = listen_conn; next; next = next->next) { if (do_accept) { update_event(next, EV_READ | EV_PERSIST); if (listen(next->sfd, settings.backlog) != 0) { perror("listen"); } } ...
DoS
0
void do_accept_new_conns(const bool do_accept) { conn *next; for (next = listen_conn; next; next = next->next) { if (do_accept) { update_event(next, EV_READ | EV_PERSIST); if (listen(next->sfd, settings.backlog) != 0) { perror("listen"); } } ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,625
enum delta_result_type do_add_delta(conn *c, item *it, const bool incr, const int64_t delta, char *buf) { char *ptr; uint64_t value; int res; ptr = ITEM_data(it); if (!safe_strtoull(ptr, &value)) { return NON_NUMERIC; } if (incr) { value...
DoS
0
enum delta_result_type do_add_delta(conn *c, item *it, const bool incr, const int64_t delta, char *buf) { char *ptr; uint64_t value; int res; ptr = ITEM_data(it); if (!safe_strtoull(ptr, &value)) { return NON_NUMERIC; } if (incr) { value...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,626
static int enable_large_pages(void) { #if defined(HAVE_GETPAGESIZES) && defined(HAVE_MEMCNTL) int ret = -1; size_t sizes[32]; int avail = getpagesizes(sizes, 32); if (avail != -1) { size_t max = sizes[0]; struct memcntl_mha arg = {0}; int ii; for (ii = 1; ii < avail; ++i...
DoS
0
static int enable_large_pages(void) { #if defined(HAVE_GETPAGESIZES) && defined(HAVE_MEMCNTL) int ret = -1; size_t sizes[32]; int avail = getpagesizes(sizes, 32); if (avail != -1) { size_t max = sizes[0]; struct memcntl_mha arg = {0}; int ii; for (ii = 1; ii < avail; ++i...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,627
static int ensure_iov_space(conn *c) { assert(c != NULL); if (c->iovused >= c->iovsize) { int i, iovnum; struct iovec *new_iov = (struct iovec *)realloc(c->iov, (c->iovsize * 2) * sizeof(struct iovec)); if (! new_iov) return -1; c->iov...
DoS
0
static int ensure_iov_space(conn *c) { assert(c != NULL); if (c->iovused >= c->iovsize) { int i, iovnum; struct iovec *new_iov = (struct iovec *)realloc(c->iov, (c->iovsize * 2) * sizeof(struct iovec)); if (! new_iov) return -1; c->iov...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,628
void event_handler(const int fd, const short which, void *arg) { conn *c; c = (conn *)arg; assert(c != NULL); c->which = which; /* sanity */ if (fd != c->sfd) { if (settings.verbose > 0) fprintf(stderr, "Catastrophic: event fd doesn't match conn fd!\n"); conn_close...
DoS
0
void event_handler(const int fd, const short which, void *arg) { conn *c; c = (conn *)arg; assert(c != NULL); c->which = which; /* sanity */ if (fd != c->sfd) { if (settings.verbose > 0) fprintf(stderr, "Catastrophic: event fd doesn't match conn fd!\n"); conn_close...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,629
static bool grow_stats_buf(conn *c, size_t needed) { size_t nsize = c->stats.size; size_t available = nsize - c->stats.offset; bool rv = true; /* Special case: No buffer -- need to allocate fresh */ if (c->stats.buffer == NULL) { nsize = 1024; available = c->stats.size = c->stats.of...
DoS
0
static bool grow_stats_buf(conn *c, size_t needed) { size_t nsize = c->stats.size; size_t available = nsize - c->stats.offset; bool rv = true; /* Special case: No buffer -- need to allocate fresh */ if (c->stats.buffer == NULL) { nsize = 1024; available = c->stats.size = c->stats.of...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,630
static void handle_binary_protocol_error(conn *c) { write_bin_error(c, PROTOCOL_BINARY_RESPONSE_EINVAL, 0); if (settings.verbose) { fprintf(stderr, "Protocol error (opcode %02x), close connection %d\n", c->binary_header.request.opcode, c->sfd); } c->write_and_go = conn_closing; }...
DoS
0
static void handle_binary_protocol_error(conn *c) { write_bin_error(c, PROTOCOL_BINARY_RESPONSE_EINVAL, 0); if (settings.verbose) { fprintf(stderr, "Protocol error (opcode %02x), close connection %d\n", c->binary_header.request.opcode, c->sfd); } c->write_and_go = conn_closing; }...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,631
static void init_sasl_conn(conn *c) { assert(c); /* should something else be returned? */ if (!settings.sasl) return; if (!c->sasl_conn) { int result=sasl_server_new("memcached", NULL, NULL, NULL, NULL, NULL, 0, &c->s...
DoS
0
static void init_sasl_conn(conn *c) { assert(c); /* should something else be returned? */ if (!settings.sasl) return; if (!c->sasl_conn) { int result=sasl_server_new("memcached", NULL, NULL, NULL, NULL, NULL, 0, &c->s...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,632
int main (int argc, char **argv) { int c; bool lock_memory = false; bool do_daemonize = false; bool preallocate = false; int maxcore = 0; char *username = NULL; char *pid_file = NULL; struct passwd *pw; struct rlimit rlim; char unit = '\0'; int size_max = 0; /* listening ...
DoS
0
int main (int argc, char **argv) { int c; bool lock_memory = false; bool do_daemonize = false; bool preallocate = false; int maxcore = 0; char *username = NULL; char *pid_file = NULL; struct passwd *pw; struct rlimit rlim; char unit = '\0'; int size_max = 0; /* listening ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,633
static void maximize_sndbuf(const int sfd) { socklen_t intsize = sizeof(int); int last_good = 0; int min, max, avg; int old_size; /* Start with the default size. */ if (getsockopt(sfd, SOL_SOCKET, SO_SNDBUF, &old_size, &intsize) != 0) { if (settings.verbose > 0) perror("gets...
DoS
0
static void maximize_sndbuf(const int sfd) { socklen_t intsize = sizeof(int); int last_good = 0; int min, max, avg; int old_size; /* Start with the default size. */ if (getsockopt(sfd, SOL_SOCKET, SO_SNDBUF, &old_size, &intsize) != 0) { if (settings.verbose > 0) perror("gets...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,634
static int new_socket(struct addrinfo *ai) { int sfd; int flags; if ((sfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) == -1) { return -1; } if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 || fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) { perror("setting O_NONBLOCK")...
DoS
0
static int new_socket(struct addrinfo *ai) { int sfd; int flags; if ((sfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) == -1) { return -1; } if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 || fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) { perror("setting O_NONBLOCK")...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,635
static int new_socket_unix(void) { int sfd; int flags; if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket()"); return -1; } if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 || fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) { perror("setting O_NONBLOCK"); ...
DoS
0
static int new_socket_unix(void) { int sfd; int flags; if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket()"); return -1; } if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 || fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) { perror("setting O_NONBLOCK"); ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,636
static void process_arithmetic_command(conn *c, token_t *tokens, const size_t ntokens, const bool incr) { char temp[INCR_MAX_STORAGE_LEN]; item *it; uint64_t delta; char *key; size_t nkey; assert(c != NULL); set_noreply_maybe(c, tokens, ntokens); if (tokens[KEY_TOKEN].length > KEY_MAX...
DoS
0
static void process_arithmetic_command(conn *c, token_t *tokens, const size_t ntokens, const bool incr) { char temp[INCR_MAX_STORAGE_LEN]; item *it; uint64_t delta; char *key; size_t nkey; assert(c != NULL); set_noreply_maybe(c, tokens, ntokens); if (tokens[KEY_TOKEN].length > KEY_MAX...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,637
static void process_bin_complete_sasl_auth(conn *c) { assert(settings.sasl); const char *out = NULL; unsigned int outlen = 0; assert(c->item); init_sasl_conn(c); int nkey = c->binary_header.request.keylen; int vlen = c->binary_header.request.bodylen - nkey; char mech[nkey+1]; memc...
DoS
0
static void process_bin_complete_sasl_auth(conn *c) { assert(settings.sasl); const char *out = NULL; unsigned int outlen = 0; assert(c->item); init_sasl_conn(c); int nkey = c->binary_header.request.keylen; int vlen = c->binary_header.request.bodylen - nkey; char mech[nkey+1]; memc...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,638
static void process_bin_delete(conn *c) { item *it; protocol_binary_request_delete* req = binary_get_request(c); char* key = binary_get_key(c); size_t nkey = c->binary_header.request.keylen; assert(c != NULL); if (settings.verbose > 1) { fprintf(stderr, "Deleting %s\n", key); } ...
DoS
0
static void process_bin_delete(conn *c) { item *it; protocol_binary_request_delete* req = binary_get_request(c); char* key = binary_get_key(c); size_t nkey = c->binary_header.request.keylen; assert(c != NULL); if (settings.verbose > 1) { fprintf(stderr, "Deleting %s\n", key); } ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,639
static void process_bin_get(conn *c) { item *it; protocol_binary_response_get* rsp = (protocol_binary_response_get*)c->wbuf; char* key = binary_get_key(c); size_t nkey = c->binary_header.request.keylen; if (settings.verbose > 1) { int ii; fprintf(stderr, "<%d GET ", c->sfd); ...
DoS
0
static void process_bin_get(conn *c) { item *it; protocol_binary_response_get* rsp = (protocol_binary_response_get*)c->wbuf; char* key = binary_get_key(c); size_t nkey = c->binary_header.request.keylen; if (settings.verbose > 1) { int ii; fprintf(stderr, "<%d GET ", c->sfd); ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,640
static void process_bin_update(conn *c) { char *key; int nkey; int vlen; item *it; protocol_binary_request_set* req = binary_get_request(c); assert(c != NULL); key = binary_get_key(c); nkey = c->binary_header.request.keylen; /* fix byteorder in the request */ req->message.body...
DoS
0
static void process_bin_update(conn *c) { char *key; int nkey; int vlen; item *it; protocol_binary_request_set* req = binary_get_request(c); assert(c != NULL); key = binary_get_key(c); nkey = c->binary_header.request.keylen; /* fix byteorder in the request */ req->message.body...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,641
static void process_command(conn *c, char *command) { token_t tokens[MAX_TOKENS]; size_t ntokens; int comm; assert(c != NULL); MEMCACHED_PROCESS_COMMAND_START(c->sfd, c->rcurr, c->rbytes); if (settings.verbose > 1) fprintf(stderr, "<%d %s\n", c->sfd, command); /* * for comm...
DoS
0
static void process_command(conn *c, char *command) { token_t tokens[MAX_TOKENS]; size_t ntokens; int comm; assert(c != NULL); MEMCACHED_PROCESS_COMMAND_START(c->sfd, c->rcurr, c->rbytes); if (settings.verbose > 1) fprintf(stderr, "<%d %s\n", c->sfd, command); /* * for comm...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,642
static void process_delete_command(conn *c, token_t *tokens, const size_t ntokens) { char *key; size_t nkey; item *it; assert(c != NULL); if (ntokens == 4) { if (!set_noreply_maybe(c, tokens, ntokens)) { out_string(c, "CLIENT_ERROR bad command line format. " ...
DoS
0
static void process_delete_command(conn *c, token_t *tokens, const size_t ntokens) { char *key; size_t nkey; item *it; assert(c != NULL); if (ntokens == 4) { if (!set_noreply_maybe(c, tokens, ntokens)) { out_string(c, "CLIENT_ERROR bad command line format. " ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,643
static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) { char *key; size_t nkey; int i = 0; item *it; token_t *key_token = &tokens[KEY_TOKEN]; char *suffix; assert(c != NULL); do { while(key_token->length != 0) { key = key_...
DoS
0
static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) { char *key; size_t nkey; int i = 0; item *it; token_t *key_token = &tokens[KEY_TOKEN]; char *suffix; assert(c != NULL); do { while(key_token->length != 0) { key = key_...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,644
static void process_stat(conn *c, token_t *tokens, const size_t ntokens) { const char *subcommand = tokens[SUBCOMMAND_TOKEN].value; assert(c != NULL); if (ntokens < 2) { out_string(c, "CLIENT_ERROR bad command line"); return; } if (ntokens == 2) { server_stats(&append_stats...
DoS
0
static void process_stat(conn *c, token_t *tokens, const size_t ntokens) { const char *subcommand = tokens[SUBCOMMAND_TOKEN].value; assert(c != NULL); if (ntokens < 2) { out_string(c, "CLIENT_ERROR bad command line"); return; } if (ntokens == 2) { server_stats(&append_stats...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,645
static void process_stat_settings(ADD_STAT add_stats, void *c) { assert(add_stats); APPEND_STAT("maxbytes", "%u", (unsigned int)settings.maxbytes); APPEND_STAT("maxconns", "%d", settings.maxconns); APPEND_STAT("tcpport", "%d", settings.port); APPEND_STAT("udpport", "%d", settings.udpport); APPEN...
DoS
0
static void process_stat_settings(ADD_STAT add_stats, void *c) { assert(add_stats); APPEND_STAT("maxbytes", "%u", (unsigned int)settings.maxbytes); APPEND_STAT("maxconns", "%d", settings.maxconns); APPEND_STAT("tcpport", "%d", settings.port); APPEND_STAT("udpport", "%d", settings.udpport); APPEN...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,646
inline static void process_stats_detail(conn *c, const char *command) { assert(c != NULL); if (strcmp(command, "on") == 0) { settings.detail_enabled = 1; out_string(c, "OK"); } else if (strcmp(command, "off") == 0) { settings.detail_enabled = 0; out_string(c, "OK"); ...
DoS
0
inline static void process_stats_detail(conn *c, const char *command) { assert(c != NULL); if (strcmp(command, "on") == 0) { settings.detail_enabled = 1; out_string(c, "OK"); } else if (strcmp(command, "off") == 0) { settings.detail_enabled = 0; out_string(c, "OK"); ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,647
static void process_update_command(conn *c, token_t *tokens, const size_t ntokens, int comm, bool handle_cas) { char *key; size_t nkey; unsigned int flags; int32_t exptime_int = 0; time_t exptime; int vlen; uint64_t req_cas_id=0; item *it; assert(c != NULL); set_noreply_maybe(c...
DoS
0
static void process_update_command(conn *c, token_t *tokens, const size_t ntokens, int comm, bool handle_cas) { char *key; size_t nkey; unsigned int flags; int32_t exptime_int = 0; time_t exptime; int vlen; uint64_t req_cas_id=0; item *it; assert(c != NULL); set_noreply_maybe(c...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,648
static void process_verbosity_command(conn *c, token_t *tokens, const size_t ntokens) { unsigned int level; assert(c != NULL); set_noreply_maybe(c, tokens, ntokens); level = strtoul(tokens[1].value, NULL, 10); settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; out_s...
DoS
0
static void process_verbosity_command(conn *c, token_t *tokens, const size_t ntokens) { unsigned int level; assert(c != NULL); set_noreply_maybe(c, tokens, ntokens); level = strtoul(tokens[1].value, NULL, 10); settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; out_s...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,649
static const char *prot_text(enum protocol prot) { char *rv = "unknown"; switch(prot) { case ascii_prot: rv = "ascii"; break; case binary_prot: rv = "binary"; break; case negotiating_prot: rv = "auto-negotiate"; brea...
DoS
0
static const char *prot_text(enum protocol prot) { char *rv = "unknown"; switch(prot) { case ascii_prot: rv = "ascii"; break; case binary_prot: rv = "binary"; break; case negotiating_prot: rv = "auto-negotiate"; brea...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,650
static rel_time_t realtime(const time_t exptime) { /* no. of seconds in 30 days - largest possible delta exptime */ if (exptime == 0) return 0; /* 0 means never expire */ if (exptime > REALTIME_MAXDELTA) { /* if item expiration is at/before the server started, give it an expiration time...
DoS
0
static rel_time_t realtime(const time_t exptime) { /* no. of seconds in 30 days - largest possible delta exptime */ if (exptime == 0) return 0; /* 0 means never expire */ if (exptime > REALTIME_MAXDELTA) { /* if item expiration is at/before the server started, give it an expiration time...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,651
static void reset_cmd_handler(conn *c) { c->cmd = -1; c->substate = bin_no_state; if(c->item != NULL) { item_remove(c->item); c->item = NULL; } conn_shrink(c); if (c->rbytes > 0) { conn_set_state(c, conn_parse_cmd); } else { conn_set_state(c, conn_waiting); ...
DoS
0
static void reset_cmd_handler(conn *c) { c->cmd = -1; c->substate = bin_no_state; if(c->item != NULL) { item_remove(c->item); c->item = NULL; } conn_shrink(c); if (c->rbytes > 0) { conn_set_state(c, conn_parse_cmd); } else { conn_set_state(c, conn_waiting); ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,652
static void save_pid(const pid_t pid, const char *pid_file) { FILE *fp; if (pid_file == NULL) return; if ((fp = fopen(pid_file, "w")) == NULL) { fprintf(stderr, "Could not open the pid file %s for writing\n", pid_file); return; } fprintf(fp,"%ld\n", (long)pid); if (fclo...
DoS
0
static void save_pid(const pid_t pid, const char *pid_file) { FILE *fp; if (pid_file == NULL) return; if ((fp = fopen(pid_file, "w")) == NULL) { fprintf(stderr, "Could not open the pid file %s for writing\n", pid_file); return; } fprintf(fp,"%ld\n", (long)pid); if (fclo...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,653
static int server_socket_unix(const char *path, int access_mask) { int sfd; struct linger ling = {0, 0}; struct sockaddr_un addr; struct stat tstat; int flags =1; int old_umask; if (!path) { return 1; } if ((sfd = new_socket_unix()) == -1) { return 1; } /* ...
DoS
0
static int server_socket_unix(const char *path, int access_mask) { int sfd; struct linger ling = {0, 0}; struct sockaddr_un addr; struct stat tstat; int flags =1; int old_umask; if (!path) { return 1; } if ((sfd = new_socket_unix()) == -1) { return 1; } /* ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,654
static void server_stats(ADD_STAT add_stats, conn *c) { pid_t pid = getpid(); rel_time_t now = current_time; struct thread_stats thread_stats; threadlocal_stats_aggregate(&thread_stats); struct slab_stats slab_stats; slab_stats_aggregate(&thread_stats, &slab_stats); #ifndef WIN32 struct ru...
DoS
0
static void server_stats(ADD_STAT add_stats, conn *c) { pid_t pid = getpid(); rel_time_t now = current_time; struct thread_stats thread_stats; threadlocal_stats_aggregate(&thread_stats); struct slab_stats slab_stats; slab_stats_aggregate(&thread_stats, &slab_stats); #ifndef WIN32 struct ru...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,655
static void set_current_time(void) { struct timeval timer; gettimeofday(&timer, NULL); current_time = (rel_time_t) (timer.tv_sec - process_started); }
DoS
0
static void set_current_time(void) { struct timeval timer; gettimeofday(&timer, NULL); current_time = (rel_time_t) (timer.tv_sec - process_started); }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,656
static inline bool set_noreply_maybe(conn *c, token_t *tokens, size_t ntokens) { int noreply_index = ntokens - 2; /* NOTE: this function is not the first place where we are going to send the reply. We could send it instead from process_command() if the request line has wrong number of tokens...
DoS
0
static inline bool set_noreply_maybe(conn *c, token_t *tokens, size_t ntokens) { int noreply_index = ntokens - 2; /* NOTE: this function is not the first place where we are going to send the reply. We could send it instead from process_command() if the request line has wrong number of tokens...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,657
static void settings_init(void) { settings.use_cas = true; settings.access = 0700; settings.port = 11211; settings.udpport = 11211; /* By default this string should be NULL for getaddrinfo() */ settings.inter = NULL; settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */ settings.ma...
DoS
0
static void settings_init(void) { settings.use_cas = true; settings.access = 0700; settings.port = 11211; settings.udpport = 11211; /* By default this string should be NULL for getaddrinfo() */ settings.inter = NULL; settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */ settings.ma...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,658
static void sig_handler(const int sig) { printf("SIGINT handled.\n"); exit(EXIT_SUCCESS); }
DoS
0
static void sig_handler(const int sig) { printf("SIGINT handled.\n"); exit(EXIT_SUCCESS); }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,659
static int sigignore(int sig) { struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 }; if (sigemptyset(&sa.sa_mask) == -1 || sigaction(sig, &sa, 0) == -1) { return -1; } return 0; }
DoS
0
static int sigignore(int sig) { struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 }; if (sigemptyset(&sa.sa_mask) == -1 || sigaction(sig, &sa, 0) == -1) { return -1; } return 0; }
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,660
static const char *state_text(enum conn_states state) { const char* const statenames[] = { "conn_listening", "conn_new_cmd", "conn_waiting", "conn_read", "conn_...
DoS
0
static const char *state_text(enum conn_states state) { const char* const statenames[] = { "conn_listening", "conn_new_cmd", "conn_waiting", "conn_read", "conn_...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,661
static void stats_init(void) { stats.curr_items = stats.total_items = stats.curr_conns = stats.total_conns = stats.conn_structs = 0; stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = stats.evictions = 0; stats.curr_bytes = stats.listen_disabled_num = 0; stats.accepting_conns = true; ...
DoS
0
static void stats_init(void) { stats.curr_items = stats.total_items = stats.curr_conns = stats.total_conns = stats.conn_structs = 0; stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = stats.evictions = 0; stats.curr_bytes = stats.listen_disabled_num = 0; stats.accepting_conns = true; ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,662
static size_t tokenize_command(char *command, token_t *tokens, const size_t max_tokens) { char *s, *e; size_t ntokens = 0; assert(command != NULL && tokens != NULL && max_tokens > 1); for (s = e = command; ntokens < max_tokens - 1; ++e) { if (*e == ' ') { if (s != e) { ...
DoS
0
static size_t tokenize_command(char *command, token_t *tokens, const size_t max_tokens) { char *s, *e; size_t ntokens = 0; assert(command != NULL && tokens != NULL && max_tokens > 1); for (s = e = command; ntokens < max_tokens - 1; ++e) { if (*e == ' ') { if (s != e) { ...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,663
static enum try_read_result try_read_network(conn *c) { enum try_read_result gotdata = READ_NO_DATA_RECEIVED; int res; int num_allocs = 0; assert(c != NULL); if (c->rcurr != c->rbuf) { if (c->rbytes != 0) /* otherwise there's nothing to copy */ memmove(c->rbuf, c->rcurr, c->rbyt...
DoS
0
static enum try_read_result try_read_network(conn *c) { enum try_read_result gotdata = READ_NO_DATA_RECEIVED; int res; int num_allocs = 0; assert(c != NULL); if (c->rcurr != c->rbuf) { if (c->rbytes != 0) /* otherwise there's nothing to copy */ memmove(c->rbuf, c->rcurr, c->rbyt...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,664
static bool update_event(conn *c, const int new_flags) { assert(c != NULL); struct event_base *base = c->event.ev_base; if (c->ev_flags == new_flags) return true; if (event_del(&c->event) == -1) return false; event_set(&c->event, c->sfd, new_flags, event_handler, (void *)c); event_base_...
DoS
0
static bool update_event(conn *c, const int new_flags) { assert(c != NULL); struct event_base *base = c->event.ev_base; if (c->ev_flags == new_flags) return true; if (event_del(&c->event) == -1) return false; event_set(&c->event, c->sfd, new_flags, event_handler, (void *)c); event_base_...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,665
static void usage_license(void) { printf(PACKAGE " " VERSION "\n\n"); printf( "Copyright (c) 2003, Danga Interactive, Inc. <http://www.danga.com/>\n" "All rights reserved.\n" "\n" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided tha...
DoS
0
static void usage_license(void) { printf(PACKAGE " " VERSION "\n\n"); printf( "Copyright (c) 2003, Danga Interactive, Inc. <http://www.danga.com/>\n" "All rights reserved.\n" "\n" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided tha...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,666
static void write_bin_error(conn *c, protocol_binary_response_status err, int swallow) { const char *errstr = "Unknown error"; size_t len; switch (err) { case PROTOCOL_BINARY_RESPONSE_ENOMEM: errstr = "Out of memory"; break; case PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND: err...
DoS
0
static void write_bin_error(conn *c, protocol_binary_response_status err, int swallow) { const char *errstr = "Unknown error"; size_t len; switch (err) { case PROTOCOL_BINARY_RESPONSE_ENOMEM: errstr = "Out of memory"; break; case PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND: err...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,667
static void write_bin_response(conn *c, void *d, int hlen, int keylen, int dlen) { if (!c->noreply || c->cmd == PROTOCOL_BINARY_CMD_GET || c->cmd == PROTOCOL_BINARY_CMD_GETK) { add_bin_header(c, 0, hlen, keylen, dlen); if(dlen > 0) { add_iov(c, d, dlen); } conn_se...
DoS
0
static void write_bin_response(conn *c, void *d, int hlen, int keylen, int dlen) { if (!c->noreply || c->cmd == PROTOCOL_BINARY_CMD_GET || c->cmd == PROTOCOL_BINARY_CMD_GETK) { add_bin_header(c, 0, hlen, keylen, dlen); if(dlen > 0) { add_iov(c, d, dlen); } conn_se...
@@ -3148,7 +3148,9 @@ static int try_read_command(conn *c) { ++ptr; } - if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { + if (ptr - c->rcurr > 100 || + (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5))) { + ...
CWE-20
null
null
14,668
assert_no_event (struct EventFixture *ef) { fd_set rfds; FD_ZERO(&rfds); FD_SET(ef->test_sock, &rfds); struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 0; /* check if there's any data waiting */ int res = select(ef->test_sock + 1, &rfds, NULL, NULL, &timeout); if(res...
Exec Code
0
assert_no_event (struct EventFixture *ef) { fd_set rfds; FD_ZERO(&rfds); FD_SET(ef->test_sock, &rfds); struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 0; /* check if there's any data waiting */ int res = select(ef->test_sock + 1, &rfds, NULL, NULL, &timeout); if(res...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,669
assert_str_beginswith(GString *expected, gchar *actual) { gchar *actual_beginning = g_strndup(actual, expected->len); g_assert_cmpstr(expected->str, ==, actual_beginning); g_free(actual_beginning); /* return the part of the actual string that hasn't been compared yet */ return &actual[expected->len...
Exec Code
0
assert_str_beginswith(GString *expected, gchar *actual) { gchar *actual_beginning = g_strndup(actual, expected->len); g_assert_cmpstr(expected->str, ==, actual_beginning); g_free(actual_beginning); /* return the part of the actual string that hasn't been compared yet */ return &actual[expected->len...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,670
assert_sync_beginswith_stdarg() { GString *stdargs = g_string_new(""); g_string_append_printf(stdargs, "%s %d %d ", uzbl.state.config_file, getpid(), (int)uzbl.xwin); g_string_append_printf(stdargs, "%s %s ", uzbl.comm.fifo_path, uzbl.comm.socket_path); g_string_append_printf(stdargs, "%s %s ", uzbl.st...
Exec Code
0
assert_sync_beginswith_stdarg() { GString *stdargs = g_string_new(""); g_string_append_printf(stdargs, "%s %d %d ", uzbl.state.config_file, getpid(), (int)uzbl.xwin); g_string_append_printf(stdargs, "%s %s ", uzbl.comm.fifo_path, uzbl.comm.socket_path); g_string_append_printf(stdargs, "%s %s ", uzbl.st...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,671
event_fixture_setup(struct EventFixture *ef, const void* data) { (void) data; int socks[2]; /* make some sockets, fresh for every test */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1) { perror("socketpair() failed"); g_assert(0); } ef->uzbl_sock = socks[0]; ef->test...
Exec Code
0
event_fixture_setup(struct EventFixture *ef, const void* data) { (void) data; int socks[2]; /* make some sockets, fresh for every test */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1) { perror("socketpair() failed"); g_assert(0); } ef->uzbl_sock = socks[0]; ef->test...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,672
event_fixture_teardown(struct EventFixture *ef, const void *data) { (void) data; /* there should be no events left waiting */ assert_no_event(ef); /* clean up the io channel we opened for uzbl */ GIOChannel *iochan = g_ptr_array_index(uzbl.comm.client_chan, 0); remove_socket_from_array(iochan)...
Exec Code
0
event_fixture_teardown(struct EventFixture *ef, const void *data) { (void) data; /* there should be no events left waiting */ assert_no_event(ef); /* clean up the io channel we opened for uzbl */ GIOChannel *iochan = g_ptr_array_index(uzbl.comm.client_chan, 0); remove_socket_from_array(iochan)...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,673
main (int argc, char *argv[]) { /* set up tests */ g_type_init(); g_test_init(&argc, &argv, NULL); g_test_add("/test-command/set-variable", struct EventFixture, NULL, event_fixture_setup, test_set_variable, event_fixture_teardown); g_test_add("/test-command/event", struct EventFixture, N...
Exec Code
0
main (int argc, char *argv[]) { /* set up tests */ g_type_init(); g_test_init(&argc, &argv, NULL); g_test_add("/test-command/set-variable", struct EventFixture, NULL, event_fixture_setup, test_set_variable, event_fixture_teardown); g_test_add("/test-command/event", struct EventFixture, N...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,674
read_event (struct EventFixture *ef) { int r = read(ef->test_sock, ef->event_buffer, 1023); \ ef->event_buffer[r] = 0; }
Exec Code
0
read_event (struct EventFixture *ef) { int r = read(ef->test_sock, ef->event_buffer, 1023); \ ef->event_buffer[r] = 0; }
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,675
test_print (void) { GString *result = g_string_new(""); /* a simple message can be returned as a result */ parse_cmd_line("print A simple test", result); g_assert_cmpstr("A simple test", ==, result->str); /* arguments to print should be expanded */ parse_cmd_line("print A simple @(echo expansi...
Exec Code
0
test_print (void) { GString *result = g_string_new(""); /* a simple message can be returned as a result */ parse_cmd_line("print A simple test", result); g_assert_cmpstr("A simple test", ==, result->str); /* arguments to print should be expanded */ parse_cmd_line("print A simple @(echo expansi...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,676
test_scroll (void) { uzbl.gui.scbar_v = (GtkScrollbar*) gtk_vscrollbar_new (NULL); uzbl.gui.bar_v = gtk_range_get_adjustment((GtkRange*) uzbl.gui.scbar_v); gtk_adjustment_set_lower(uzbl.gui.bar_v, 0); gtk_adjustment_set_upper(uzbl.gui.bar_v, 100); gtk_adjustment_set_page_size(uzbl.gui.bar_v, 5); ...
Exec Code
0
test_scroll (void) { uzbl.gui.scbar_v = (GtkScrollbar*) gtk_vscrollbar_new (NULL); uzbl.gui.bar_v = gtk_range_get_adjustment((GtkRange*) uzbl.gui.scbar_v); gtk_adjustment_set_lower(uzbl.gui.bar_v, 0); gtk_adjustment_set_upper(uzbl.gui.bar_v, 100); gtk_adjustment_set_page_size(uzbl.gui.bar_v, 5); ...
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,677
test_sync_sh (void) { parse_cmd_line("sync_sh 'echo Test echo.'", NULL); g_assert_cmpstr("Test echo.\n", ==, uzbl.comm.sync_stdout); /* clean up after ourselves */ uzbl.comm.sync_stdout = strfree(uzbl.comm.sync_stdout); }
Exec Code
0
test_sync_sh (void) { parse_cmd_line("sync_sh 'echo Test echo.'", NULL); g_assert_cmpstr("Test echo.\n", ==, uzbl.comm.sync_stdout); /* clean up after ourselves */ uzbl.comm.sync_stdout = strfree(uzbl.comm.sync_stdout); }
@@ -305,11 +305,6 @@ test_js (void) { parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); - /* uzbl commands can be run from javascript */ - uzbl.net.useragent = "Test useragent"; - parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result...
CWE-264
null
null
14,678
VIEWFUNC(reload) VIEWFUNC(reload_bypass_cache) VIEWFUNC(stop_loading) VIEWFUNC(zoom_in) VIEWFUNC(zoom_out) VIEWFUNC(go_back) VIEWFUNC(go_forward) #undef VIEWFUNC /* -- command to callback/function map for things we cannot attach to any signals */ struct {const char *key; CommandInfo value;} cmdlist[] =
Exec Code
0
VIEWFUNC(reload) VIEWFUNC(reload_bypass_cache) VIEWFUNC(stop_loading) VIEWFUNC(zoom_in) VIEWFUNC(zoom_out) VIEWFUNC(go_back) VIEWFUNC(go_forward) #undef VIEWFUNC /* -- command to callback/function map for things we cannot attach to any signals */ struct {const char *key; CommandInfo value;} cmdlist[] =
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,679
act_dump_config_as_events() { dump_config_as_events(); }
Exec Code
0
act_dump_config_as_events() { dump_config_as_events(); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,680
add_to_menu(GArray *argv, guint context) { GUI *g = &uzbl.gui; MenuItem *m; gchar *item_cmd = NULL; if(!argv_idx(argv, 0)) return; gchar **split = g_strsplit(argv_idx(argv, 0), "=", 2); if(!g->menu_items) g->menu_items = g_ptr_array_new(); if(split[1]) item_cmd = g...
Exec Code
0
add_to_menu(GArray *argv, guint context) { GUI *g = &uzbl.gui; MenuItem *m; gchar *item_cmd = NULL; if(!argv_idx(argv, 0)) return; gchar **split = g_strsplit(argv_idx(argv, 0), "=", 2); if(!g->menu_items) g->menu_items = g_ptr_array_new(); if(split[1]) item_cmd = g...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,681
argv_idx(const GArray *a, const guint idx) { return g_array_index(a, gchar*, idx); }
Exec Code
0
argv_idx(const GArray *a, const guint idx) { return g_array_index(a, gchar*, idx); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,682
catch_signal(int s) { if(s == SIGTERM || s == SIGINT || s == SIGILL || s == SIGFPE || s == SIGQUIT) { clean_up(); exit(EXIT_SUCCESS); } else if(s == SIGSEGV) { clean_up(); fprintf(stderr, "Program aborted, segmentation fault!\nAttempting to clea...
Exec Code
0
catch_signal(int s) { if(s == SIGTERM || s == SIGINT || s == SIGILL || s == SIGFPE || s == SIGQUIT) { clean_up(); exit(EXIT_SUCCESS); } else if(s == SIGSEGV) { clean_up(); fprintf(stderr, "Program aborted, segmentation fault!\nAttempting to clea...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,683
chain (WebKitWebView *page, GArray *argv, GString *result) { (void) page; (void) result; gchar *a = NULL; gchar **parts = NULL; guint i = 0; while ((a = argv_idx(argv, i++))) { parts = g_strsplit (a, " ", 2); if (parts[0]) parse_command(parts[0], parts[1], result); ...
Exec Code
0
chain (WebKitWebView *page, GArray *argv, GString *result) { (void) page; (void) result; gchar *a = NULL; gchar **parts = NULL; guint i = 0; while ((a = argv_idx(argv, i++))) { parts = g_strsplit (a, " ", 2); if (parts[0]) parse_command(parts[0], parts[1], result); ...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,684
close_uzbl (WebKitWebView *page, GArray *argv, GString *result) { (void)page; (void)argv; (void)result; gtk_main_quit (); }
Exec Code
0
close_uzbl (WebKitWebView *page, GArray *argv, GString *result) { (void)page; (void)argv; (void)result; gtk_main_quit (); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,685
control_client_socket(GIOChannel *clientchan) { char *ctl_line; GString *result = g_string_new(""); GError *error = NULL; GIOStatus ret; gsize len; ret = g_io_channel_read_line(clientchan, &ctl_line, &len, NULL, &error); if (ret == G_IO_STATUS_ERROR) { g_warning ("Error reading: %s\...
Exec Code
0
control_client_socket(GIOChannel *clientchan) { char *ctl_line; GString *result = g_string_new(""); GError *error = NULL; GIOStatus ret; gsize len; ret = g_io_channel_read_line(clientchan, &ctl_line, &len, NULL, &error); if (ret == G_IO_STATUS_ERROR) { g_warning ("Error reading: %s\...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,686
control_fifo(GIOChannel *gio, GIOCondition condition) { if (uzbl.state.verbose) printf("triggered\n"); gchar *ctl_line; GIOStatus ret; GError *err = NULL; if (condition & G_IO_HUP) g_error ("Fifo: Read end of pipe died!\n"); if(!gio) g_error ("Fifo: GIOChannel broke\n");...
Exec Code
0
control_fifo(GIOChannel *gio, GIOCondition condition) { if (uzbl.state.verbose) printf("triggered\n"); gchar *ctl_line; GIOStatus ret; GError *err = NULL; if (condition & G_IO_HUP) g_error ("Fifo: Read end of pipe died!\n"); if(!gio) g_error ("Fifo: GIOChannel broke\n");...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,687
control_socket(GIOChannel *chan) { struct sockaddr_un remote; unsigned int t = sizeof(remote); GIOChannel *iochan; int clientsock; clientsock = accept (g_io_channel_unix_get_fd(chan), (struct sockaddr *) &remote, &t); if(!uzbl.comm.client_chan) uzbl.comm.client...
Exec Code
0
control_socket(GIOChannel *chan) { struct sockaddr_un remote; unsigned int t = sizeof(remote); GIOChannel *iochan; int clientsock; clientsock = accept (g_io_channel_unix_get_fd(chan), (struct sockaddr *) &remote, &t); if(!uzbl.comm.client_chan) uzbl.comm.client...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,688
create_browser () { GUI *g = &uzbl.gui; g->web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ()); g_object_connect((GObject*)g->web_view, "signal::key-press-event", (GCallback)key_press_cb, NULL, "signal::key-release-event", (GCallback)key_relea...
Exec Code
0
create_browser () { GUI *g = &uzbl.gui; g->web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ()); g_object_connect((GObject*)g->web_view, "signal::key-press-event", (GCallback)key_press_cb, NULL, "signal::key-release-event", (GCallback)key_relea...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,689
create_plug () { GtkPlug* plug = GTK_PLUG (gtk_plug_new (uzbl.state.socket_id)); g_signal_connect (G_OBJECT (plug), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (plug), "key-press-event", G_CALLBACK (key_press_cb), NULL); g_signal_connect (G_OBJECT (plug), "key-release-event", G...
Exec Code
0
create_plug () { GtkPlug* plug = GTK_PLUG (gtk_plug_new (uzbl.state.socket_id)); g_signal_connect (G_OBJECT (plug), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (plug), "key-press-event", G_CALLBACK (key_press_cb), NULL); g_signal_connect (G_OBJECT (plug), "key-release-event", G...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,690
create_window () { GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); gtk_widget_set_name (window, "Uzbl browser"); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (...
Exec Code
0
create_window () { GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); gtk_widget_set_name (window, "Uzbl browser"); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,691
dump_config() { g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash, NULL); }
Exec Code
0
dump_config() { g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash, NULL); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,692
dump_config_as_events() { g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash_as_event, NULL); }
Exec Code
0
dump_config_as_events() { g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash_as_event, NULL); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,693
dump_var_hash_as_event(gpointer k, gpointer v, gpointer ud) { (void) ud; uzbl_cmdprop *c = v; GString *msg; if(!c->dump) return; /* check for the variable type */ msg = g_string_new((char *)k); if (c->type == TYPE_STR) { g_string_append_printf(msg, " str %s", *c->ptr.s ? *c...
Exec Code
0
dump_var_hash_as_event(gpointer k, gpointer v, gpointer ud) { (void) ud; uzbl_cmdprop *c = v; GString *msg; if(!c->dump) return; /* check for the variable type */ msg = g_string_new((char *)k); if (c->type == TYPE_STR) { g_string_append_printf(msg, " str %s", *c->ptr.s ? *c...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,694
event(WebKitWebView *page, GArray *argv, GString *result) { (void) page; (void) result; GString *event_name; gchar **split = NULL; if(!argv_idx(argv, 0)) return; split = g_strsplit(argv_idx(argv, 0), " ", 2); if(split[0]) event_name = g_string_ascii_up(g_string_new(split[0])); ...
Exec Code
0
event(WebKitWebView *page, GArray *argv, GString *result) { (void) page; (void) result; GString *event_name; gchar **split = NULL; if(!argv_idx(argv, 0)) return; split = g_strsplit(argv_idx(argv, 0), " ", 2); if(split[0]) event_name = g_string_ascii_up(g_string_new(split[0])); ...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,695
expand(const char *s, guint recurse) { uzbl_cmdprop *c; enum exp_type etype; char *end_simple_var = "^°!\"§$%&/()=?'`'+~*'#-.:,;@<>| \\{}[]¹²³¼½"; char *ret = NULL; char *vend = NULL; GError *err = NULL; gchar *cmd_stdout = NULL; gchar *mycmd = NULL; GString *buf = g_string_new(""); ...
Exec Code
0
expand(const char *s, guint recurse) { uzbl_cmdprop *c; enum exp_type etype; char *end_simple_var = "^°!\"§$%&/()=?'`'+~*'#-.:,;@<>| \\{}[]¹²³¼½"; char *ret = NULL; char *vend = NULL; GError *err = NULL; gchar *cmd_stdout = NULL; gchar *mycmd = NULL; GString *buf = g_string_new(""); ...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,696
file_exists (const char * filename) { return (access(filename, F_OK) == 0); }
Exec Code
0
file_exists (const char * filename) { return (access(filename, F_OK) == 0); }
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,697
find_existing_file(gchar* path_list) { int i=0; int cnt; gchar **split; gchar *tmp = NULL; gchar *executable; if(!path_list) return NULL; split = g_strsplit(path_list, ":", 0); while(split[i]) i++; if(i<=1) { tmp = g_strdup(split[0]); g_strfreev(spl...
Exec Code
0
find_existing_file(gchar* path_list) { int i=0; int cnt; gchar **split; gchar *tmp = NULL; gchar *executable; if(!path_list) return NULL; split = g_strsplit(path_list, ":", 0); while(split[i]) i++; if(i<=1) { tmp = g_strdup(split[0]); g_strfreev(spl...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,698
find_xdg_file (int xdg_type, const char* filename) { /* xdg_type = 0 => config xdg_type = 1 => data xdg_type = 2 => cache*/ gchar* xdgv = get_xdg_var (XDG[xdg_type]); gchar* temporary_file = g_strconcat (xdgv, filename, NULL); g_free (xdgv); gchar* temporary_string; char* savept...
Exec Code
0
find_xdg_file (int xdg_type, const char* filename) { /* xdg_type = 0 => config xdg_type = 1 => data xdg_type = 2 => cache*/ gchar* xdgv = get_xdg_var (XDG[xdg_type]); gchar* temporary_file = g_strconcat (xdgv, filename, NULL); g_free (xdgv); gchar* temporary_string; char* savept...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null
14,699
get_exp_type(const gchar *s) { /* variables */ if(*(s+1) == '(') return EXP_EXPR; else if(*(s+1) == '{') return EXP_BRACED_VAR; else if(*(s+1) == '<') return EXP_JS; else if(*(s+1) == '[') return EXP_ESCAPE; else return EXP_SIMPLE_VAR; /*@notreached@*...
Exec Code
0
get_exp_type(const gchar *s) { /* variables */ if(*(s+1) == '(') return EXP_EXPR; else if(*(s+1) == '{') return EXP_BRACED_VAR; else if(*(s+1) == '<') return EXP_JS; else if(*(s+1) == '[') return EXP_ESCAPE; else return EXP_SIMPLE_VAR; /*@notreached@*...
@@ -1046,7 +1046,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; - JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; @@ -1059,12 +1058,6 @@ eval_js(WebKitWebView * web_vie...
CWE-264
null
null