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,700 | include(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
gchar *pe = NULL,
*path = NULL,
*line;
int i=0;
if(!argv_idx(argv, 0))
return;
pe = parseenv(argv_idx(argv, 0));
if((path = find_existing_file(pe))) {
GArray* lin... | Exec Code | 0 | include(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
gchar *pe = NULL,
*path = NULL,
*line;
int i=0;
if(!argv_idx(argv, 0))
return;
pe = parseenv(argv_idx(argv, 0));
if((path = find_existing_file(pe))) {
GArray* lin... | @@ -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,701 | init_connect_socket() {
int sockfd, replay = 0;
struct sockaddr_un local;
GIOChannel *chan;
gchar **name = NULL;
if(!uzbl.comm.connect_chan)
uzbl.comm.connect_chan = g_ptr_array_new();
name = uzbl.state.connect_socket_names;
while(name && *name) {
sockfd = socket (AF_UNIX,... | Exec Code | 0 | init_connect_socket() {
int sockfd, replay = 0;
struct sockaddr_un local;
GIOChannel *chan;
gchar **name = NULL;
if(!uzbl.comm.connect_chan)
uzbl.comm.connect_chan = g_ptr_array_new();
name = uzbl.state.connect_socket_names;
while(name && *name) {
sockfd = socket (AF_UNIX,... | @@ -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,702 | init_fifo(gchar *dir) { /* return dir or, on error, free dir and return NULL */
if (uzbl.comm.fifo_path) { /* get rid of the old fifo if one exists */
if (unlink(uzbl.comm.fifo_path) == -1)
g_warning ("Fifo: Can't unlink old fifo at %s\n", uzbl.comm.fifo_path);
g_free(uzbl.comm.fifo_path... | Exec Code | 0 | init_fifo(gchar *dir) { /* return dir or, on error, free dir and return NULL */
if (uzbl.comm.fifo_path) { /* get rid of the old fifo if one exists */
if (unlink(uzbl.comm.fifo_path) == -1)
g_warning ("Fifo: Can't unlink old fifo at %s\n", uzbl.comm.fifo_path);
g_free(uzbl.comm.fifo_path... | @@ -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,703 | init_socket(gchar *dir) { /* return dir or, on error, free dir and return NULL */
if (uzbl.comm.socket_path) { /* remove an existing socket should one exist */
if (unlink(uzbl.comm.socket_path) == -1)
g_warning ("init_socket: couldn't unlink socket at %s\n", uzbl.comm.socket_path);
g_fre... | Exec Code | 0 | init_socket(gchar *dir) { /* return dir or, on error, free dir and return NULL */
if (uzbl.comm.socket_path) { /* remove an existing socket should one exist */
if (unlink(uzbl.comm.socket_path) == -1)
g_warning ("init_socket: couldn't unlink socket at %s\n", uzbl.comm.socket_path);
g_fre... | @@ -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,704 | initialize(int argc, char *argv[]) {
int i;
for(i=0; i<argc; ++i) {
if(!strcmp(argv[i], "-s") || !strcmp(argv[i], "--socket")) {
uzbl.state.plug_mode = TRUE;
break;
}
}
if (!g_thread_supported ())
g_thread_init (NULL);
gtk_init (&argc, &argv);
u... | Exec Code | 0 | initialize(int argc, char *argv[]) {
int i;
for(i=0; i<argc; ++i) {
if(!strcmp(argv[i], "-s") || !strcmp(argv[i], "--socket")) {
uzbl.state.plug_mode = TRUE;
break;
}
}
if (!g_thread_supported ())
g_thread_init (NULL);
gtk_init (&argc, &argv);
u... | @@ -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,705 | itos(int val) {
char tmp[20];
snprintf(tmp, sizeof(tmp), "%i", val);
return g_strdup(tmp);
}
| Exec Code | 0 | itos(int val) {
char tmp[20];
snprintf(tmp, sizeof(tmp), "%i", val);
return g_strdup(tmp);
}
| @@ -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,706 | js_init() {
/* This function creates the class and its definition, only once */
if (!uzbl.js.initialized) {
/* it would be pretty cool to make this dynamic */
uzbl.js.classdef = kJSClassDefinitionEmpty;
uzbl.js.classdef.staticFunctions = js_static_functions;
uzbl.js.classref = J... | Exec Code | 0 | js_init() {
/* This function creates the class and its definition, only once */
if (!uzbl.js.initialized) {
/* it would be pretty cool to make this dynamic */
uzbl.js.classdef = kJSClassDefinitionEmpty;
uzbl.js.classdef.staticFunctions = js_static_functions;
uzbl.js.classref = J... | @@ -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,707 | js_run_command (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
(void) function;
(void) thisObject;
(void) exception;
JSStringRef js_result_string;
GString *result = g_string... | Exec Code | 0 | js_run_command (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
(void) function;
(void) thisObject;
(void) exception;
JSStringRef js_result_string;
GString *result = g_string... | @@ -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,708 | load_uri (WebKitWebView *web_view, GArray *argv, GString *result) {
(void) web_view; (void) result;
load_uri_imp (argv_idx (argv, 0));
}
| Exec Code | 0 | load_uri (WebKitWebView *web_view, GArray *argv, GString *result) {
(void) web_view; (void) result;
load_uri_imp (argv_idx (argv, 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,709 | load_uri_imp(gchar *uri) {
GString* newuri;
if (g_strstr_len (uri, 11, "javascript:") != NULL) {
eval_js(uzbl.gui.web_view, uri, NULL);
return;
}
newuri = g_string_new (uri);
if (!soup_uri_new(uri)) {
GString* fullpath = g_string_new ("");
if (g_path_is_absolute (newu... | Exec Code | 0 | load_uri_imp(gchar *uri) {
GString* newuri;
if (g_strstr_len (uri, 11, "javascript:") != NULL) {
eval_js(uzbl.gui.web_view, uri, NULL);
return;
}
newuri = g_string_new (uri);
if (!soup_uri_new(uri)) {
GString* fullpath = g_string_new ("");
if (g_path_is_absolute (newu... | @@ -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,710 | main (int argc, char* argv[]) {
initialize(argc, argv);
uzbl.gui.scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (uzbl.gui.scrolled_win),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
gtk_container_add (GTK_CONTAINER (uzbl.gui.scrolled_win),
... | Exec Code | 0 | main (int argc, char* argv[]) {
initialize(argc, argv);
uzbl.gui.scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (uzbl.gui.scrolled_win),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
gtk_container_add (GTK_CONTAINER (uzbl.gui.scrolled_win),
... | @@ -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,711 | menu_add(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT);
}
| Exec Code | 0 | menu_add(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT);
}
| @@ -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,712 | menu_add_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| Exec Code | 0 | menu_add_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| @@ -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,713 | menu_add_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| Exec Code | 0 | menu_add_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| @@ -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,714 | menu_add_separator(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT);
}
| Exec Code | 0 | menu_add_separator(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT);
}
| @@ -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,715 | menu_add_separator_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| Exec Code | 0 | menu_add_separator_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| @@ -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,716 | menu_add_separator_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| Exec Code | 0 | menu_add_separator_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
add_separator_to_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| @@ -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,717 | menu_remove_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
remove_from_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| Exec Code | 0 | menu_remove_edit(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
remove_from_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE);
}
| @@ -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,718 | menu_remove_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
remove_from_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| Exec Code | 0 | menu_remove_image(WebKitWebView *page, GArray *argv, GString *result) {
(void) page;
(void) result;
remove_from_menu(argv, WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE);
}
| @@ -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,719 | move_statusbar() {
if (!uzbl.gui.scrolled_win &&
!uzbl.gui.mainbar)
return;
g_object_ref(uzbl.gui.scrolled_win);
g_object_ref(uzbl.gui.mainbar);
gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uzbl.gui.scrolled_win);
gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uzbl.gui... | Exec Code | 0 | move_statusbar() {
if (!uzbl.gui.scrolled_win &&
!uzbl.gui.mainbar)
return;
g_object_ref(uzbl.gui.scrolled_win);
g_object_ref(uzbl.gui.mainbar);
gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uzbl.gui.scrolled_win);
gtk_container_remove(GTK_CONTAINER(uzbl.gui.vbox), uzbl.gui... | @@ -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,720 | new_window_load_uri (const gchar * uri) {
if (uzbl.behave.new_window) {
GString *s = g_string_new ("");
g_string_printf(s, "'%s'", uri);
run_handler(uzbl.behave.new_window, s->str);
send_event(NEW_WINDOW, s->str, NULL);
return;
}
GString* to_execute = g_string_new (""... | Exec Code | 0 | new_window_load_uri (const gchar * uri) {
if (uzbl.behave.new_window) {
GString *s = g_string_new ("");
g_string_printf(s, "'%s'", uri);
run_handler(uzbl.behave.new_window, s->str);
send_event(NEW_WINDOW, s->str, NULL);
return;
}
GString* to_execute = 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,721 | parse_cmd_line(const char *ctl_line, GString *result) {
size_t len=0;
gchar *ctlstrip = NULL;
gchar *exp_line = NULL;
gchar *work_string = NULL;
work_string = g_strdup(ctl_line);
/* strip trailing newline */
len = strlen(ctl_line);
if (work_string[len - 1] == '\n')
ctlstrip = g... | Exec Code | 0 | parse_cmd_line(const char *ctl_line, GString *result) {
size_t len=0;
gchar *ctlstrip = NULL;
gchar *exp_line = NULL;
gchar *work_string = NULL;
work_string = g_strdup(ctl_line);
/* strip trailing newline */
len = strlen(ctl_line);
if (work_string[len - 1] == '\n')
ctlstrip = 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,722 | parse_command(const char *cmd, const char *param, GString *result) {
CommandInfo *c;
GString *tmp = g_string_new("");
if ((c = g_hash_table_lookup(uzbl.behave.commands, cmd))) {
guint i;
gchar **par = split_quoted(param, TRUE);
GArray *a = g_array_new (TRUE, FALSE, sizeo... | Exec Code | 0 | parse_command(const char *cmd, const char *param, GString *result) {
CommandInfo *c;
GString *tmp = g_string_new("");
if ((c = g_hash_table_lookup(uzbl.behave.commands, cmd))) {
guint i;
gchar **par = split_quoted(param, TRUE);
GArray *a = g_array_new (TRUE, FALSE, sizeo... | @@ -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,723 | read_file_by_line (const gchar *path) {
GIOChannel *chan = NULL;
gchar *readbuf = NULL;
gsize len;
GArray *lines = g_array_new(TRUE, FALSE, sizeof(gchar*));
int i = 0;
chan = g_io_channel_new_file(path, "r", NULL);
if (chan) {
while (g_io_channel_read_line(chan, &readbuf, &len, NULL... | Exec Code | 0 | read_file_by_line (const gchar *path) {
GIOChannel *chan = NULL;
gchar *readbuf = NULL;
gsize len;
GArray *lines = g_array_new(TRUE, FALSE, sizeof(gchar*));
int i = 0;
chan = g_io_channel_new_file(path, "r", NULL);
if (chan) {
while (g_io_channel_read_line(chan, &readbuf, &len, 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,724 | remove_socket_from_array(GIOChannel *chan) {
gboolean ret = 0;
/* TODO: Do wee need to manually free the IO channel or is this
* happening implicitly on unref?
*/
ret = g_ptr_array_remove_fast(uzbl.comm.connect_chan, chan);
if(!ret)
ret = g_ptr_array_remove_fast(uzbl.comm.client... | Exec Code | 0 | remove_socket_from_array(GIOChannel *chan) {
gboolean ret = 0;
/* TODO: Do wee need to manually free the IO channel or is this
* happening implicitly on unref?
*/
ret = g_ptr_array_remove_fast(uzbl.comm.connect_chan, chan);
if(!ret)
ret = g_ptr_array_remove_fast(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,725 | run_external_js (WebKitWebView * web_view, GArray *argv, GString *result) {
(void) result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
GArray* lines = read_file_by_line (path);
gchar* js = NULL;
int i = 0;
gchar*... | Exec Code | 0 | run_external_js (WebKitWebView * web_view, GArray *argv, GString *result) {
(void) result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
GArray* lines = read_file_by_line (path);
gchar* js = NULL;
int i = 0;
gchar*... | @@ -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,726 | run_handler (const gchar *act, const gchar *args) {
/* Consider this code a temporary hack to make the handlers usable.
In practice, all this splicing, injection, and reconstruction is
inefficient, annoying and hard to manage. Potential pitfalls arise
when the handler specific args 1) are not ... | Exec Code | 0 | run_handler (const gchar *act, const gchar *args) {
/* Consider this code a temporary hack to make the handlers usable.
In practice, all this splicing, injection, and reconstruction is
inefficient, annoying and hard to manage. Potential pitfalls arise
when the handler specific args 1) are not ... | @@ -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,727 | run_js (WebKitWebView * web_view, GArray *argv, GString *result) {
if (argv_idx(argv, 0))
eval_js(web_view, argv_idx(argv, 0), result);
}
| Exec Code | 0 | run_js (WebKitWebView * web_view, GArray *argv, GString *result) {
if (argv_idx(argv, 0))
eval_js(web_view, argv_idx(argv, 0), 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,728 | save_cookies (SoupMessage *msg, gpointer user_data){
(void) user_data;
GSList *ck;
char *cookie;
for (ck = soup_cookies_from_response(msg); ck; ck = ck->next){
cookie = soup_cookie_to_set_cookie_header(ck->data);
SoupURI * soup_uri = soup_message_get_uri(msg);
GString *s = g_stri... | Exec Code | 0 | save_cookies (SoupMessage *msg, gpointer user_data){
(void) user_data;
GSList *ck;
char *cookie;
for (ck = soup_cookies_from_response(msg); ck; ck = ck->next){
cookie = soup_cookie_to_set_cookie_header(ck->data);
SoupURI * soup_uri = soup_message_get_uri(msg);
GString *s = g_stri... | @@ -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,729 | search_clear(WebKitWebView *page, GArray *argv, GString *result) {
(void) argv;
(void) result;
webkit_web_view_unmark_text_matches (page);
if(uzbl.state.searchtx) {
g_free(uzbl.state.searchtx);
uzbl.state.searchtx = NULL;
}
}
| Exec Code | 0 | search_clear(WebKitWebView *page, GArray *argv, GString *result) {
(void) argv;
(void) result;
webkit_web_view_unmark_text_matches (page);
if(uzbl.state.searchtx) {
g_free(uzbl.state.searchtx);
uzbl.state.searchtx = 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,730 | search_reverse_text (WebKitWebView *page, GArray *argv, GString *result) {
(void) result;
search_text(page, argv, FALSE);
}
| Exec Code | 0 | search_reverse_text (WebKitWebView *page, GArray *argv, GString *result) {
(void) result;
search_text(page, argv, FALSE);
}
| @@ -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,731 | search_text (WebKitWebView *page, GArray *argv, const gboolean forward) {
if (argv_idx(argv, 0) && (*argv_idx(argv, 0) != '\0')) {
if (g_strcmp0 (uzbl.state.searchtx, argv_idx(argv, 0)) != 0) {
webkit_web_view_unmark_text_matches (page);
webkit_web_view_mark_text_matches (page, argv_... | Exec Code | 0 | search_text (WebKitWebView *page, GArray *argv, const gboolean forward) {
if (argv_idx(argv, 0) && (*argv_idx(argv, 0) != '\0')) {
if (g_strcmp0 (uzbl.state.searchtx, argv_idx(argv, 0)) != 0) {
webkit_web_view_unmark_text_matches (page);
webkit_web_view_mark_text_matches (page, argv_... | @@ -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,732 | set_var(WebKitWebView *page, GArray *argv, GString *result) {
(void) page; (void) result;
if(!argv_idx(argv, 0))
return;
gchar **split = g_strsplit(argv_idx(argv, 0), "=", 2);
if (split[0] != NULL) {
gchar *value = parseenv(split[1] ? g_strchug(split[1]) : " ");
set_var_value(g... | Exec Code | 0 | set_var(WebKitWebView *page, GArray *argv, GString *result) {
(void) page; (void) result;
if(!argv_idx(argv, 0))
return;
gchar **split = g_strsplit(argv_idx(argv, 0), "=", 2);
if (split[0] != NULL) {
gchar *value = parseenv(split[1] ? g_strchug(split[1]) : " ");
set_var_value(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,733 | set_var_value(const gchar *name, gchar *val) {
uzbl_cmdprop *c = NULL;
char *endp = NULL;
char *buf = NULL;
char *invalid_chars = "^°!\"§$%&/()=?'`'+~*'#-.:,;@<>| \\{}[]¹²³¼½";
GString *msg;
if( (c = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
if(!c->writeable) return FALSE;
... | Exec Code | 0 | set_var_value(const gchar *name, gchar *val) {
uzbl_cmdprop *c = NULL;
char *endp = NULL;
char *buf = NULL;
char *invalid_chars = "^°!\"§$%&/()=?'`'+~*'#-.:,;@<>| \\{}[]¹²³¼½";
GString *msg;
if( (c = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
if(!c->writeable) return FALSE;
... | @@ -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,734 | setup_signal(int signr, sigfunc *shandler) {
struct sigaction nh, oh;
nh.sa_handler = shandler;
sigemptyset(&nh.sa_mask);
nh.sa_flags = 0;
if(sigaction(signr, &nh, &oh) < 0)
return SIG_ERR;
return NULL;
}
| Exec Code | 0 | setup_signal(int signr, sigfunc *shandler) {
struct sigaction nh, oh;
nh.sa_handler = shandler;
sigemptyset(&nh.sa_mask);
nh.sa_flags = 0;
if(sigaction(signr, &nh, &oh) < 0)
return SIG_ERR;
return 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,735 | sharg_append(GArray *a, const gchar *str) {
const gchar *s = (str ? str : "");
g_array_append_val(a, s);
}
| Exec Code | 0 | sharg_append(GArray *a, const gchar *str) {
const gchar *s = (str ? str : "");
g_array_append_val(a, 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,736 | spawn(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
run_command(path, 0,
((const gchar **) (argv->data + sizeof(gchar*))),
... | Exec Code | 0 | spawn(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
run_command(path, 0,
((const gchar **) (argv->data + sizeof(gchar*))),
... | @@ -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,737 | spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
if (!uzbl.behave.shell_cmd) {
g_printerr ("spawn_sh: shell_cmd is not set!\n");
return;
}
guint i;
gchar *spacer = g_strdup("");
g_array_insert_val(argv, 1, spacer);
gchar **cmd ... | Exec Code | 0 | spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
if (!uzbl.behave.shell_cmd) {
g_printerr ("spawn_sh: shell_cmd is not set!\n");
return;
}
guint i;
gchar *spacer = g_strdup("");
g_array_insert_val(argv, 1, spacer);
gchar **cmd ... | @@ -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,738 | spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
run_command(path, 0,
((const gchar **) (argv->data + sizeof(gchar*))),
... | Exec Code | 0 | spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
gchar *path = NULL;
if (argv_idx(argv, 0) &&
((path = find_existing_file(argv_idx(argv, 0)))) ) {
run_command(path, 0,
((const gchar **) (argv->data + sizeof(gchar*))),
... | @@ -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,739 | str_replace (const char* search, const char* replace, const char* string) {
gchar **buf;
char *ret;
if(!string)
return NULL;
buf = g_strsplit (string, search, -1);
ret = g_strjoinv (replace, buf);
g_strfreev(buf);
return ret;
}
| Exec Code | 0 | str_replace (const char* search, const char* replace, const char* string) {
gchar **buf;
char *ret;
if(!string)
return NULL;
buf = g_strsplit (string, search, -1);
ret = g_strjoinv (replace, buf);
g_strfreev(buf);
return ret;
}
| @@ -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,740 | strfree(gchar *str) {
g_free(str);
return NULL;
}
| Exec Code | 0 | strfree(gchar *str) {
g_free(str);
return 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,741 | talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
int fd, len;
struct sockaddr_un sa;
char* sockpath;
ssize_t ret;
struct pollfd pfd;
struct iovec* iov;
guint i;
if(uzbl.comm.sync_stdout) uzbl.comm.sync_stdout = strfree(uzbl.comm... | Exec Code | 0 | talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result) {
(void)web_view; (void)result;
int fd, len;
struct sockaddr_un sa;
char* sockpath;
ssize_t ret;
struct pollfd pfd;
struct iovec* iov;
guint i;
if(uzbl.comm.sync_stdout) uzbl.comm.sync_stdout = strfree(uzbl.comm... | @@ -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,742 | update_title (void) {
Behaviour *b = &uzbl.behave;
gchar *parsed;
if (b->show_status) {
if (b->title_format_short) {
parsed = expand(b->title_format_short, 0);
if (uzbl.gui.main_window)
gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed);
... | Exec Code | 0 | update_title (void) {
Behaviour *b = &uzbl.behave;
gchar *parsed;
if (b->show_status) {
if (b->title_format_short) {
parsed = expand(b->title_format_short, 0);
if (uzbl.gui.main_window)
gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed);
... | @@ -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,743 | static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
{
int ret;
int nblocks;
APEContext *ape = s->priv_data;
uint32_t extra_size = 8;
if (s->pb->eof_reached)
return AVERROR(EIO);
if (ape->currentframe > ape->totalframes)
return AVERROR(EIO);
avio_seek (s->pb, ape... | DoS | 0 | static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
{
int ret;
int nblocks;
APEContext *ape = s->priv_data;
uint32_t extra_size = 8;
if (s->pb->eof_reached)
return AVERROR(EIO);
if (ape->currentframe > ape->totalframes)
return AVERROR(EIO);
avio_seek (s->pb, ape... | @@ -242,6 +242,10 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
}
+ if(!ape->totalframes){
+ av_log(s, AV_LOG_ERROR, "No frames in the file!\n");
+ return AVERROR(EINVAL);
+ }
if(ape->totalframes > ... | CWE-399 | null | null |
14,744 | static int ape_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
AVStream *st = s->streams[stream_index];
APEContext *ape = s->priv_data;
int index = av_index_search_timestamp(st, timestamp, flags);
if (index < 0)
return -1;
ape->currentframe = index;
retu... | DoS | 0 | static int ape_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
AVStream *st = s->streams[stream_index];
APEContext *ape = s->priv_data;
int index = av_index_search_timestamp(st, timestamp, flags);
if (index < 0)
return -1;
ape->currentframe = index;
retu... | @@ -242,6 +242,10 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
}
+ if(!ape->totalframes){
+ av_log(s, AV_LOG_ERROR, "No frames in the file!\n");
+ return AVERROR(EINVAL);
+ }
if(ape->totalframes > ... | CWE-399 | null | null |
14,745 | static void antiidle(void)
{
if (noopidle == (time_t) -1) {
noopidle = time(NULL);
} else {
if ((time(NULL) - noopidle) > (time_t) idletime_noop) {
die(421, LOG_INFO, MSG_TIMEOUT_NOOP, (unsigned long) idletime_noop);
}
}
}
| null | 0 | static void antiidle(void)
{
if (noopidle == (time_t) -1) {
noopidle = time(NULL);
} else {
if ((time(NULL) - noopidle) > (time_t) idletime_noop) {
die(421, LOG_INFO, MSG_TIMEOUT_NOOP, (unsigned long) idletime_noop);
}
}
}
| @@ -57,14 +57,20 @@ static void randomdelay(void)
* -Frank.
*/
+static size_t scanned;
+static size_t readnbd;
+
+static void flush_cmd(void)
+{
+ scanned = readnbd = (size_t) 0U;
+}
+
int sfgets(void)
{
struct pollfd pfd;
int pollret;
ssize_t readnb;
signed char seen_r = 0;
- static s... | CWE-399 | null | null |
14,746 | static char *revealextraspc(char * const s_)
{
unsigned char *s = (unsigned char *) s_;
unsigned char *sn;
if (s == NULL) {
return s_;
}
simplify(s_);
while (*s != 0U && isspace(*s)) {
*s++ = '_';
}
if (*s == 0U) {
return s_;
}
sn = s;
do {
... | null | 0 | static char *revealextraspc(char * const s_)
{
unsigned char *s = (unsigned char *) s_;
unsigned char *sn;
if (s == NULL) {
return s_;
}
simplify(s_);
while (*s != 0U && isspace(*s)) {
*s++ = '_';
}
if (*s == 0U) {
return s_;
}
sn = s;
do {
... | @@ -57,14 +57,20 @@ static void randomdelay(void)
* -Frank.
*/
+static size_t scanned;
+static size_t readnbd;
+
+static void flush_cmd(void)
+{
+ scanned = readnbd = (size_t) 0U;
+}
+
int sfgets(void)
{
struct pollfd pfd;
int pollret;
ssize_t readnb;
signed char seen_r = 0;
- static s... | CWE-399 | null | null |
14,747 | int authorized_client(CLIENT *opts) {
const char *ERRMSG="Invalid entry '%s' in authfile '%s', so, refusing all connections.";
FILE *f ;
char line[LINELEN];
char *tmp;
struct in_addr addr;
struct in_addr client;
struct in_addr cltemp;
int len;
if ((f=fopen(opts->server->authname,"r"))==NULL) {
msg4(LOG_INF... | Exec Code Overflow | 0 | int authorized_client(CLIENT *opts) {
const char *ERRMSG="Invalid entry '%s' in authfile '%s', so, refusing all connections.";
FILE *f ;
char line[LINELEN];
char *tmp;
struct in_addr addr;
struct in_addr client;
struct in_addr cltemp;
int len;
if ((f=fopen(opts->server->authname,"r"))==NULL) {
msg4(LOG_INF... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,748 | int copyonwrite_prepare(CLIENT* client) {
off_t i;
if ((client->difffilename = malloc(1024))==NULL)
err("Failed to allocate string for diff file name");
snprintf(client->difffilename, 1024, "%s-%s-%d.diff",client->exportname,client->clientname,
(int)getpid()) ;
client->difffilename[1023]='\0';
msg3(LOG_INFO,"A... | Exec Code Overflow | 0 | int copyonwrite_prepare(CLIENT* client) {
off_t i;
if ((client->difffilename = malloc(1024))==NULL)
err("Failed to allocate string for diff file name");
snprintf(client->difffilename, 1024, "%s-%s-%d.diff",client->exportname,client->clientname,
(int)getpid()) ;
client->difffilename[1023]='\0';
msg3(LOG_INFO,"A... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,749 | void daemonize(SERVER* serve) {
FILE*pidf;
if(serve && !(serve->port)) {
return;
}
if(daemon(0,0)<0) {
err("daemon");
}
if(!*pidftemplate) {
if(serve) {
strncpy(pidftemplate, "/var/run/nbd-server.%d.pid", 255);
} else {
strncpy(pidftemplate, "/var/run/nbd-server.pid", 255);
}
}
snprintf(pidfnam... | Exec Code Overflow | 0 | void daemonize(SERVER* serve) {
FILE*pidf;
if(serve && !(serve->port)) {
return;
}
if(daemon(0,0)<0) {
err("daemon");
}
if(!*pidftemplate) {
if(serve) {
strncpy(pidftemplate, "/var/run/nbd-server.%d.pid", 255);
} else {
strncpy(pidftemplate, "/var/run/nbd-server.pid", 255);
}
}
snprintf(pidfnam... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,750 | void destroy_pid_t(gpointer data) {
g_free(data);
}
| Exec Code Overflow | 0 | void destroy_pid_t(gpointer data) {
g_free(data);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,751 | int do_run(gchar* command, gchar* file) {
gchar* cmd;
int retval=0;
if(command && *command) {
cmd = g_strdup_printf(command, file);
retval=system(cmd);
g_free(cmd);
}
return retval;
}
| Exec Code Overflow | 0 | int do_run(gchar* command, gchar* file) {
gchar* cmd;
int retval=0;
if(command && *command) {
cmd = g_strdup_printf(command, file);
retval=system(cmd);
g_free(cmd);
}
return retval;
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,752 | void dosockopts(int socket) {
#ifndef sun
int yes=1;
#else
char yes='1';
#endif /* sun */
int sock_flags;
/* lose the pesky "Address already in use" error message */
if (setsockopt(socket,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int)) == -1) {
err("setsockopt SO_REUSEADDR");
}
if (setsockopt(socket,SOL_SOCK... | Exec Code Overflow | 0 | void dosockopts(int socket) {
#ifndef sun
int yes=1;
#else
char yes='1';
#endif /* sun */
int sock_flags;
/* lose the pesky "Address already in use" error message */
if (setsockopt(socket,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int)) == -1) {
err("setsockopt SO_REUSEADDR");
}
if (setsockopt(socket,SOL_SOCK... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,753 | void dousers(void) {
struct passwd *pw;
struct group *gr;
gchar* str;
if(rungroup) {
gr=getgrnam(rungroup);
if(!gr) {
str = g_strdup_printf("Invalid group name: %s", rungroup);
err(str);
}
if(setgid(gr->gr_gid)<0) {
err("Could not set GID: %m");
}
}
if(runuser) {
pw=getpwnam(runuser);
if(!... | Exec Code Overflow | 0 | void dousers(void) {
struct passwd *pw;
struct group *gr;
gchar* str;
if(rungroup) {
gr=getgrnam(rungroup);
if(!gr) {
str = g_strdup_printf("Invalid group name: %s", rungroup);
err(str);
}
if(setgid(gr->gr_gid)<0) {
err("Could not set GID: %m");
}
}
if(runuser) {
pw=getpwnam(runuser);
if(!... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,754 | SERVER* dup_serve(SERVER *s) {
SERVER *serve = NULL;
serve=g_new0(SERVER, 1);
if(serve == NULL)
return NULL;
if(s->exportname)
serve->exportname = g_strdup(s->exportname);
serve->expected_size = s->expected_size;
if(s->listenaddr)
serve->listenaddr = g_strdup(s->listenaddr);
serve->port = s->port;
i... | Exec Code Overflow | 0 | SERVER* dup_serve(SERVER *s) {
SERVER *serve = NULL;
serve=g_new0(SERVER, 1);
if(serve == NULL)
return NULL;
if(s->exportname)
serve->exportname = g_strdup(s->exportname);
serve->expected_size = s->expected_size;
if(s->listenaddr)
serve->listenaddr = g_strdup(s->listenaddr);
serve->port = s->port;
i... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,755 | int expread(off_t a, char *buf, size_t len, CLIENT *client) {
off_t rdlen, offset;
off_t mapcnt, mapl, maph, pagestart;
if (!(client->server->flags & F_COPYONWRITE))
return(rawexpread_fully(a, buf, len, client));
DEBUG3("Asked to read %d bytes at %llu.\n", len, (unsigned long long)a);
mapl=a/DIFFPAGESIZE; maph... | Exec Code Overflow | 0 | int expread(off_t a, char *buf, size_t len, CLIENT *client) {
off_t rdlen, offset;
off_t mapcnt, mapl, maph, pagestart;
if (!(client->server->flags & F_COPYONWRITE))
return(rawexpread_fully(a, buf, len, client));
DEBUG3("Asked to read %d bytes at %llu.\n", len, (unsigned long long)a);
mapl=a/DIFFPAGESIZE; maph... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,756 | int expwrite(off_t a, char *buf, size_t len, CLIENT *client) {
char pagebuf[DIFFPAGESIZE];
off_t mapcnt,mapl,maph;
off_t wrlen,rdlen;
off_t pagestart;
off_t offset;
if (!(client->server->flags & F_COPYONWRITE))
return(rawexpwrite_fully(a, buf, len, client));
DEBUG3("Asked to write %d bytes at %llu.\n", len,... | Exec Code Overflow | 0 | int expwrite(off_t a, char *buf, size_t len, CLIENT *client) {
char pagebuf[DIFFPAGESIZE];
off_t mapcnt,mapl,maph;
off_t wrlen,rdlen;
off_t pagestart;
off_t offset;
if (!(client->server->flags & F_COPYONWRITE))
return(rawexpwrite_fully(a, buf, len, client));
DEBUG3("Asked to write %d bytes at %llu.\n", len,... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,757 | int get_filepos(GArray* export, off_t a, int* fhandle, off_t* foffset, size_t* maxbytes ) {
/* Negative offset not allowed */
if(a < 0)
return -1;
/* Binary search for last file with starting offset <= a */
FILE_INFO fi;
int start = 0;
int end = export->len - 1;
while( start <= end ) {
int mid = (start + en... | Exec Code Overflow | 0 | int get_filepos(GArray* export, off_t a, int* fhandle, off_t* foffset, size_t* maxbytes ) {
/* Negative offset not allowed */
if(a < 0)
return -1;
/* Binary search for last file with starting offset <= a */
FILE_INFO fi;
int start = 0;
int end = export->len - 1;
while( start <= end ) {
int mid = (start + en... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,758 | void killchild(gpointer key, gpointer value, gpointer user_data) {
pid_t *pid=value;
int *parent=user_data;
kill(*pid, SIGTERM);
*parent=1;
}
| Exec Code Overflow | 0 | void killchild(gpointer key, gpointer value, gpointer user_data) {
pid_t *pid=value;
int *parent=user_data;
kill(*pid, SIGTERM);
*parent=1;
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,759 | void myseek(int handle,off_t a) {
if (lseek(handle, a, SEEK_SET) < 0) {
err("Can not seek locally!\n");
}
}
| Exec Code Overflow | 0 | void myseek(int handle,off_t a) {
if (lseek(handle, a, SEEK_SET) < 0) {
err("Can not seek locally!\n");
}
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,760 | void open_modern(void) {
struct addrinfo hints;
struct addrinfo* ai = NULL;
struct sock_flags;
int e;
memset(&hints, '\0', sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
hints.ai_protocol = IPPROTO_TCP;
e = getaddrinfo(modern_listen,... | Exec Code Overflow | 0 | void open_modern(void) {
struct addrinfo hints;
struct addrinfo* ai = NULL;
struct sock_flags;
int e;
memset(&hints, '\0', sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
hints.ai_protocol = IPPROTO_TCP;
e = getaddrinfo(modern_listen,... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,761 | GArray* parse_cfile(gchar* f, GError** e) {
const char* DEFAULT_ERROR = "Could not parse %s in group %s: %s";
const char* MISSING_REQUIRED_ERROR = "Could not find required value %s in group %s: %s";
SERVER s;
gchar *virtstyle=NULL;
PARAM lp[] = {
{ "exportname", TRUE, PARAM_STRING, NULL, 0 },
{ "port", TRUE,... | Exec Code Overflow | 0 | GArray* parse_cfile(gchar* f, GError** e) {
const char* DEFAULT_ERROR = "Could not parse %s in group %s: %s";
const char* MISSING_REQUIRED_ERROR = "Could not find required value %s in group %s: %s";
SERVER s;
gchar *virtstyle=NULL;
PARAM lp[] = {
{ "exportname", TRUE, PARAM_STRING, NULL, 0 },
{ "port", TRUE,... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,762 | ssize_t rawexpread(off_t a, char *buf, size_t len, CLIENT *client) {
int fhandle;
off_t foffset;
size_t maxbytes;
if(get_filepos(client->export, a, &fhandle, &foffset, &maxbytes))
return -1;
if(maxbytes && len > maxbytes)
len = maxbytes;
DEBUG4("(READ from fd %d offset %llu len %u), ", fhandle, foffset, len... | Exec Code Overflow | 0 | ssize_t rawexpread(off_t a, char *buf, size_t len, CLIENT *client) {
int fhandle;
off_t foffset;
size_t maxbytes;
if(get_filepos(client->export, a, &fhandle, &foffset, &maxbytes))
return -1;
if(maxbytes && len > maxbytes)
len = maxbytes;
DEBUG4("(READ from fd %d offset %llu len %u), ", fhandle, foffset, len... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,763 | int rawexpread_fully(off_t a, char *buf, size_t len, CLIENT *client) {
ssize_t ret=0;
while(len > 0 && (ret=rawexpread(a, buf, len, client)) > 0 ) {
a += ret;
buf += ret;
len -= ret;
}
return (ret < 0 || len != 0);
}
| Exec Code Overflow | 0 | int rawexpread_fully(off_t a, char *buf, size_t len, CLIENT *client) {
ssize_t ret=0;
while(len > 0 && (ret=rawexpread(a, buf, len, client)) > 0 ) {
a += ret;
buf += ret;
len -= ret;
}
return (ret < 0 || len != 0);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,764 | ssize_t rawexpwrite(off_t a, char *buf, size_t len, CLIENT *client) {
int fhandle;
off_t foffset;
size_t maxbytes;
ssize_t retval;
if(get_filepos(client->export, a, &fhandle, &foffset, &maxbytes))
return -1;
if(maxbytes && len > maxbytes)
len = maxbytes;
DEBUG4("(WRITE to fd %d offset %llu len %u), ", fhan... | Exec Code Overflow | 0 | ssize_t rawexpwrite(off_t a, char *buf, size_t len, CLIENT *client) {
int fhandle;
off_t foffset;
size_t maxbytes;
ssize_t retval;
if(get_filepos(client->export, a, &fhandle, &foffset, &maxbytes))
return -1;
if(maxbytes && len > maxbytes)
len = maxbytes;
DEBUG4("(WRITE to fd %d offset %llu len %u), ", fhan... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,765 | int rawexpwrite_fully(off_t a, char *buf, size_t len, CLIENT *client) {
ssize_t ret=0;
while(len > 0 && (ret=rawexpwrite(a, buf, len, client)) > 0 ) {
a += ret;
buf += ret;
len -= ret;
}
return (ret < 0 || len != 0);
}
| Exec Code Overflow | 0 | int rawexpwrite_fully(off_t a, char *buf, size_t len, CLIENT *client) {
ssize_t ret=0;
while(len > 0 && (ret=rawexpwrite(a, buf, len, client)) > 0 ) {
a += ret;
buf += ret;
len -= ret;
}
return (ret < 0 || len != 0);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,766 | inline void readit(int f, void *buf, size_t len) {
ssize_t res;
while (len > 0) {
DEBUG("*");
if ((res = read(f, buf, len)) <= 0) {
if(errno != EAGAIN) {
err("Read failed: %m");
}
} else {
len -= res;
buf += res;
}
}
}
| Exec Code Overflow | 0 | inline void readit(int f, void *buf, size_t len) {
ssize_t res;
while (len > 0) {
DEBUG("*");
if ((res = read(f, buf, len)) <= 0) {
if(errno != EAGAIN) {
err("Read failed: %m");
}
} else {
len -= res;
buf += res;
}
}
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,767 | void remove_server(gpointer s) {
SERVER *server;
server=(SERVER*)s;
g_free(server->exportname);
if(server->authname)
g_free(server->authname);
if(server->listenaddr)
g_free(server->listenaddr);
if(server->prerun)
g_free(server->prerun);
if(server->postrun)
g_free(server->postrun);
g_free(server);
}
| Exec Code Overflow | 0 | void remove_server(gpointer s) {
SERVER *server;
server=(SERVER*)s;
g_free(server->exportname);
if(server->authname)
g_free(server->authname);
if(server->listenaddr)
g_free(server->listenaddr);
if(server->prerun)
g_free(server->prerun);
if(server->postrun)
g_free(server->postrun);
g_free(server);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,768 | void serve_err(SERVER* serve, const char* msg) {
g_message("Export of %s on port %d failed:", serve->exportname,
serve->port);
err(msg);
}
| Exec Code Overflow | 0 | void serve_err(SERVER* serve, const char* msg) {
g_message("Export of %s on port %d failed:", serve->exportname,
serve->port);
err(msg);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,769 | void serveconnection(CLIENT *client) {
if(do_run(client->server->prerun, client->exportname)) {
exit(EXIT_FAILURE);
}
setupexport(client);
if (client->server->flags & F_COPYONWRITE) {
copyonwrite_prepare(client);
}
setmysockopt(client->net);
mainloop(client);
do_run(client->server->postrun, client->expor... | Exec Code Overflow | 0 | void serveconnection(CLIENT *client) {
if(do_run(client->server->prerun, client->exportname)) {
exit(EXIT_FAILURE);
}
setupexport(client);
if (client->server->flags & F_COPYONWRITE) {
copyonwrite_prepare(client);
}
setmysockopt(client->net);
mainloop(client);
do_run(client->server->postrun, client->expor... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,770 | int serveloop(GArray* servers) {
struct sockaddr_storage addrin;
socklen_t addrinlen=sizeof(addrin);
int i;
int max;
int sock;
fd_set mset;
fd_set rset;
/*
* Set up the master fd_set. The set of descriptors we need
* to select() for never changes anyway and it buys us a *lot*
* of time to only build thi... | Exec Code Overflow | 0 | int serveloop(GArray* servers) {
struct sockaddr_storage addrin;
socklen_t addrinlen=sizeof(addrin);
int i;
int max;
int sock;
fd_set mset;
fd_set rset;
/*
* Set up the master fd_set. The set of descriptors we need
* to select() for never changes anyway and it buys us a *lot*
* of time to only build thi... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,771 | void set_peername(int net, CLIENT *client) {
struct sockaddr_storage addrin;
struct sockaddr_storage netaddr;
struct sockaddr_in *netaddr4 = NULL;
struct sockaddr_in6 *netaddr6 = NULL;
size_t addrinlen = sizeof( addrin );
struct addrinfo hints;
struct addrinfo *ai = NULL;
char peername[NI_MAXHOST];
char netna... | Exec Code Overflow | 0 | void set_peername(int net, CLIENT *client) {
struct sockaddr_storage addrin;
struct sockaddr_storage netaddr;
struct sockaddr_in *netaddr4 = NULL;
struct sockaddr_in6 *netaddr6 = NULL;
size_t addrinlen = sizeof( addrin );
struct addrinfo hints;
struct addrinfo *ai = NULL;
char peername[NI_MAXHOST];
char netna... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,772 | int setup_serve(SERVER *serve) {
struct addrinfo hints;
struct addrinfo *ai = NULL;
gchar *port = NULL;
int e;
if(!do_oldstyle) {
return serve->servename ? 1 : 0;
}
memset(&hints,'\0',sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_NUMERICSERV;
hints.ai_socktype = SOCK_STREAM;
hints.ai_fam... | Exec Code Overflow | 0 | int setup_serve(SERVER *serve) {
struct addrinfo hints;
struct addrinfo *ai = NULL;
gchar *port = NULL;
int e;
if(!do_oldstyle) {
return serve->servename ? 1 : 0;
}
memset(&hints,'\0',sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_NUMERICSERV;
hints.ai_socktype = SOCK_STREAM;
hints.ai_fam... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,773 | void sigchld_handler(int s) {
int status;
int* i;
pid_t pid;
while((pid=waitpid(-1, &status, WNOHANG)) > 0) {
if(WIFEXITED(status)) {
msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status));
}
i=g_hash_table_lookup(children, &pid);
if(!i) {
msg3(LOG_INFO, "SIGCHLD received for an unknown c... | Exec Code Overflow | 0 | void sigchld_handler(int s) {
int status;
int* i;
pid_t pid;
while((pid=waitpid(-1, &status, WNOHANG)) > 0) {
if(WIFEXITED(status)) {
msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status));
}
i=g_hash_table_lookup(children, &pid);
if(!i) {
msg3(LOG_INFO, "SIGCHLD received for an unknown c... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,774 | void sigterm_handler(int s) {
int parent=0;
g_hash_table_foreach(children, killchild, &parent);
if(parent) {
unlink(pidfname);
}
exit(EXIT_SUCCESS);
}
| Exec Code Overflow | 0 | void sigterm_handler(int s) {
int parent=0;
g_hash_table_foreach(children, killchild, &parent);
if(parent) {
unlink(pidfname);
}
exit(EXIT_SUCCESS);
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,775 | void usage() {
printf("This is nbd-server version " VERSION "\n");
printf("Usage: [ip:|ip6@]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name] [-M max connections]\n"
"\t-r|--read-only\t\tread only\n"
"\t-m|--multi-file\t\tm... | Exec Code Overflow | 0 | void usage() {
printf("This is nbd-server version " VERSION "\n");
printf("Usage: [ip:|ip6@]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name] [-M max connections]\n"
"\t-r|--read-only\t\tread only\n"
"\t-m|--multi-file\t\tm... | @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,776 | inline void writeit(int f, void *buf, size_t len) {
ssize_t res;
while (len > 0) {
DEBUG("+");
if ((res = write(f, buf, len)) <= 0)
err("Send failed: %m");
len -= res;
buf += res;
}
}
| Exec Code Overflow | 0 | inline void writeit(int f, void *buf, size_t len) {
ssize_t res;
while (len > 0) {
DEBUG("+");
if ((res = write(f, buf, len)) <= 0)
err("Send failed: %m");
len -= res;
buf += res;
}
}
| @@ -150,7 +150,7 @@ gboolean do_oldstyle=FALSE;
#define OFFT_MAX ~((off_t)1<<(sizeof(off_t)*8-1))
#define LINELEN 256 /**< Size of static buffer used to read the
authorization file (yuck) */
-#define BUFSIZE (1024*1024) /**< Size of buffer that can hold requests */
+#define BUFSIZE ((1024*1024)+sizeof(st... | CWE-119 | null | null |
14,777 | static int expand_ipv6(char *addr, int type)
{
int ret;
struct in6_addr v6_addr;
ret = inet_pton(AF_INET6, addr, &v6_addr);
if (ret != 1) {
if (type == NETMASK)
return 1;
return 0;
}
sprintf(addr, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
"%02x%02x:%02x%02x:%02x%02x",
(int)v6_addr.s6_addr[0], ... | DoS | 0 | static int expand_ipv6(char *addr, int type)
{
int ret;
struct in6_addr v6_addr;
ret = inet_pton(AF_INET6, addr, &v6_addr);
if (ret != 1) {
if (type == NETMASK)
return 1;
return 0;
}
sprintf(addr, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
"%02x%02x:%02x%02x:%02x%02x",
(int)v6_addr.s6_addr[0], ... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,778 | static unsigned int hweight32(unsigned int *w)
{
unsigned int res = *w - ((*w >> 1) & 0x55555555);
res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
res = (res + (res >> 4)) & 0x0F0F0F0F;
res = res + (res >> 8);
return (res + (res >> 16)) & 0x000000FF;
}
| DoS | 0 | static unsigned int hweight32(unsigned int *w)
{
unsigned int res = *w - ((*w >> 1) & 0x55555555);
res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
res = (res + (res >> 4)) & 0x0F0F0F0F;
res = res + (res >> 8);
return (res + (res >> 16)) & 0x000000FF;
}
| @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,779 | static int is_ipv4(char *addr)
{
int ret;
struct in_addr ipv4_addr;
ret = inet_pton(AF_INET, addr, &ipv4_addr);
if (ret == 1)
return 1;
return 0;
}
| DoS | 0 | static int is_ipv4(char *addr)
{
int ret;
struct in_addr ipv4_addr;
ret = inet_pton(AF_INET, addr, &ipv4_addr);
if (ret == 1)
return 1;
return 0;
}
| @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,780 | static void kvp_acquire_lock(int pool)
{
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(kvp_file_info[pool].fd, F_SETLKW, &fl) == -1) {
syslog(LOG_ERR, "Failed to acquire the lock pool: %d", pool);
exit(EXIT_FAILURE);
}
}
| DoS | 0 | static void kvp_acquire_lock(int pool)
{
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(kvp_file_info[pool].fd, F_SETLKW, &fl) == -1) {
syslog(LOG_ERR, "Failed to acquire the lock pool: %d", pool);
exit(EXIT_FAILURE);
}
}
| @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,781 | static int kvp_file_init(void)
{
int fd;
FILE *filep;
size_t records_read;
char *fname;
struct kvp_record *record;
struct kvp_record *readp;
int num_blocks;
int i;
int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
if (access("/var/opt/hyperv", F_OK)) {
if (mkdir("/var/opt/hyperv", S_IRUSR | ... | DoS | 0 | static int kvp_file_init(void)
{
int fd;
FILE *filep;
size_t records_read;
char *fname;
struct kvp_record *record;
struct kvp_record *readp;
int num_blocks;
int i;
int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
if (access("/var/opt/hyperv", F_OK)) {
if (mkdir("/var/opt/hyperv", S_IRUSR | ... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,782 | kvp_get_domain_name(char *buffer, int length)
{
struct addrinfo hints, *info ;
int error = 0;
gethostname(buffer, length);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; /*Get only ipv4 addrinfo. */
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
error = getaddrinfo(buffer, NULL,... | DoS | 0 | kvp_get_domain_name(char *buffer, int length)
{
struct addrinfo hints, *info ;
int error = 0;
gethostname(buffer, length);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; /*Get only ipv4 addrinfo. */
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
error = getaddrinfo(buffer, NULL,... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,783 | kvp_get_ip_info(int family, char *if_name, int op,
void *out_buffer, int length)
{
struct ifaddrs *ifap;
struct ifaddrs *curp;
int offset = 0;
int sn_offset = 0;
int error = 0;
char *buffer;
struct hv_kvp_ipaddr_value *ip_buffer;
char cidr_mask[5]; /* /xyz */
int weight;
int i;
unsigned int *w;
char *sn... | DoS | 0 | kvp_get_ip_info(int family, char *if_name, int op,
void *out_buffer, int length)
{
struct ifaddrs *ifap;
struct ifaddrs *curp;
int offset = 0;
int sn_offset = 0;
int error = 0;
char *buffer;
struct hv_kvp_ipaddr_value *ip_buffer;
char cidr_mask[5]; /* /xyz */
int weight;
int i;
unsigned int *w;
char *sn... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,784 | void kvp_get_os_info(void)
{
FILE *file;
char *p, buf[512];
uname(&uts_buf);
os_version = uts_buf.release;
os_build = strdup(uts_buf.release);
os_name = uts_buf.sysname;
processor_arch = uts_buf.machine;
/*
* The current windows host (win7) expects the build
* string to be of the form: x.y.z
* Strip ad... | DoS | 0 | void kvp_get_os_info(void)
{
FILE *file;
char *p, buf[512];
uname(&uts_buf);
os_version = uts_buf.release;
os_build = strdup(uts_buf.release);
os_name = uts_buf.sysname;
processor_arch = uts_buf.machine;
/*
* The current windows host (win7) expects the build
* string to be of the form: x.y.z
* Strip ad... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,785 | static char *kvp_if_name_to_mac(char *if_name)
{
FILE *file;
char *p, *x;
char buf[256];
char addr_file[256];
int i;
char *mac_addr = NULL;
snprintf(addr_file, sizeof(addr_file), "%s%s%s", "/sys/class/net/",
if_name, "/address");
file = fopen(addr_file, "r");
if (file == NULL)
return NULL;
p =... | DoS | 0 | static char *kvp_if_name_to_mac(char *if_name)
{
FILE *file;
char *p, *x;
char buf[256];
char addr_file[256];
int i;
char *mac_addr = NULL;
snprintf(addr_file, sizeof(addr_file), "%s%s%s", "/sys/class/net/",
if_name, "/address");
file = fopen(addr_file, "r");
if (file == NULL)
return NULL;
p =... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,786 | static int kvp_key_add_or_modify(int pool, __u8 *key, int key_size, __u8 *value,
int value_size)
{
int i;
int num_records;
struct kvp_record *record;
int num_blocks;
if ((key_size > HV_KVP_EXCHANGE_MAX_KEY_SIZE) ||
(value_size > HV_KVP_EXCHANGE_MAX_VALUE_SIZE))
return 1;
/*
* First update the in-memory... | DoS | 0 | static int kvp_key_add_or_modify(int pool, __u8 *key, int key_size, __u8 *value,
int value_size)
{
int i;
int num_records;
struct kvp_record *record;
int num_blocks;
if ((key_size > HV_KVP_EXCHANGE_MAX_KEY_SIZE) ||
(value_size > HV_KVP_EXCHANGE_MAX_VALUE_SIZE))
return 1;
/*
* First update the in-memory... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,787 | static int kvp_key_delete(int pool, __u8 *key, int key_size)
{
int i;
int j, k;
int num_records;
struct kvp_record *record;
/*
* First update the in-memory state.
*/
kvp_update_mem_state(pool);
num_records = kvp_file_info[pool].num_records;
record = kvp_file_info[pool].records;
for (i = 0; i < num_recor... | DoS | 0 | static int kvp_key_delete(int pool, __u8 *key, int key_size)
{
int i;
int j, k;
int num_records;
struct kvp_record *record;
/*
* First update the in-memory state.
*/
kvp_update_mem_state(pool);
num_records = kvp_file_info[pool].num_records;
record = kvp_file_info[pool].records;
for (i = 0; i < num_recor... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,788 | static char *kvp_mac_to_if_name(char *mac)
{
DIR *dir;
struct dirent *entry;
FILE *file;
char *p, *q, *x;
char *if_name = NULL;
char buf[256];
char *kvp_net_dir = "/sys/class/net/";
char dev_id[256];
int i;
dir = opendir(kvp_net_dir);
if (dir == NULL)
return NULL;
snprintf(dev_id, sizeof(dev... | DoS | 0 | static char *kvp_mac_to_if_name(char *mac)
{
DIR *dir;
struct dirent *entry;
FILE *file;
char *p, *q, *x;
char *if_name = NULL;
char buf[256];
char *kvp_net_dir = "/sys/class/net/";
char dev_id[256];
int i;
dir = opendir(kvp_net_dir);
if (dir == NULL)
return NULL;
snprintf(dev_id, sizeof(dev... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,789 | static int kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size,
__u8 *value, int value_size)
{
struct kvp_record *record;
/*
* First update our in-memory database.
*/
kvp_update_mem_state(pool);
record = kvp_file_info[pool].records;
if (index >= kvp_file_info[pool].num_records) {
return 1;
... | DoS | 0 | static int kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size,
__u8 *value, int value_size)
{
struct kvp_record *record;
/*
* First update our in-memory database.
*/
kvp_update_mem_state(pool);
record = kvp_file_info[pool].records;
if (index >= kvp_file_info[pool].num_records) {
return 1;
... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,790 | static void kvp_process_ipconfig_file(char *cmd,
char *config_buf, int len,
int element_size, int offset)
{
char buf[256];
char *p;
char *x;
FILE *file;
/*
* First execute the command.
*/
file = popen(cmd, "r");
if (file == NULL)
return;
if (offset == 0)
memset(config_buf, 0, len);
while ((... | DoS | 0 | static void kvp_process_ipconfig_file(char *cmd,
char *config_buf, int len,
int element_size, int offset)
{
char buf[256];
char *p;
char *x;
FILE *file;
/*
* First execute the command.
*/
file = popen(cmd, "r");
if (file == NULL)
return;
if (offset == 0)
memset(config_buf, 0, len);
while ((... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,791 | static void kvp_release_lock(int pool)
{
struct flock fl = {F_UNLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(kvp_file_info[pool].fd, F_SETLK, &fl) == -1) {
perror("fcntl");
syslog(LOG_ERR, "Failed to release the lock pool: %d", pool);
exit(EXIT_FAILURE);
}
}
| DoS | 0 | static void kvp_release_lock(int pool)
{
struct flock fl = {F_UNLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(kvp_file_info[pool].fd, F_SETLK, &fl) == -1) {
perror("fcntl");
syslog(LOG_ERR, "Failed to release the lock pool: %d", pool);
exit(EXIT_FAILURE);
}
}
| @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,792 | static void kvp_update_file(int pool)
{
FILE *filep;
size_t bytes_written;
/*
* We are going to write our in-memory registry out to
* disk; acquire the lock first.
*/
kvp_acquire_lock(pool);
filep = fopen(kvp_file_info[pool].fname, "w");
if (!filep) {
kvp_release_lock(pool);
syslog(LOG_ERR, "Failed to... | DoS | 0 | static void kvp_update_file(int pool)
{
FILE *filep;
size_t bytes_written;
/*
* We are going to write our in-memory registry out to
* disk; acquire the lock first.
*/
kvp_acquire_lock(pool);
filep = fopen(kvp_file_info[pool].fname, "w");
if (!filep) {
kvp_release_lock(pool);
syslog(LOG_ERR, "Failed to... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,793 | static void kvp_update_mem_state(int pool)
{
FILE *filep;
size_t records_read = 0;
struct kvp_record *record = kvp_file_info[pool].records;
struct kvp_record *readp;
int num_blocks = kvp_file_info[pool].num_blocks;
int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
kvp_acquire_lock(pool);
filep =... | DoS | 0 | static void kvp_update_mem_state(int pool)
{
FILE *filep;
size_t records_read = 0;
struct kvp_record *record = kvp_file_info[pool].records;
struct kvp_record *readp;
int num_blocks = kvp_file_info[pool].num_blocks;
int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
kvp_acquire_lock(pool);
filep =... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,794 | static int kvp_write_file(FILE *f, char *s1, char *s2, char *s3)
{
int ret;
ret = fprintf(f, "%s%s%s%s\n", s1, s2, "=", s3);
if (ret < 0)
return HV_E_FAIL;
return 0;
}
| DoS | 0 | static int kvp_write_file(FILE *f, char *s1, char *s2, char *s3)
{
int ret;
ret = fprintf(f, "%s%s%s%s\n", s1, s2, "=", s3);
if (ret < 0)
return HV_E_FAIL;
return 0;
}
| @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,795 | netlink_send(int fd, struct cn_msg *msg)
{
struct nlmsghdr *nlh;
unsigned int size;
struct msghdr message;
char buffer[64];
struct iovec iov[2];
size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
nlh = (struct nlmsghdr *)buffer;
nlh->nlmsg_seq = 0;
nlh->nlmsg_pid = getpid();
nlh->nlmsg_type = NLMSG_DONE;... | DoS | 0 | netlink_send(int fd, struct cn_msg *msg)
{
struct nlmsghdr *nlh;
unsigned int size;
struct msghdr message;
char buffer[64];
struct iovec iov[2];
size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
nlh = (struct nlmsghdr *)buffer;
nlh->nlmsg_seq = 0;
nlh->nlmsg_pid = getpid();
nlh->nlmsg_type = NLMSG_DONE;... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,796 | static int process_ip_string(FILE *f, char *ip_string, int type)
{
int error = 0;
char addr[INET6_ADDRSTRLEN];
int i = 0;
int j = 0;
char str[256];
char sub_str[10];
int offset = 0;
memset(addr, 0, sizeof(addr));
while (parse_ip_val_buffer(ip_string, &offset, addr,
(MAX_IP_ADDR_SIZE * 2))) {
sub_str[... | DoS | 0 | static int process_ip_string(FILE *f, char *ip_string, int type)
{
int error = 0;
char addr[INET6_ADDRSTRLEN];
int i = 0;
int j = 0;
char str[256];
char sub_str[10];
int offset = 0;
memset(addr, 0, sizeof(addr));
while (parse_ip_val_buffer(ip_string, &offset, addr,
(MAX_IP_ADDR_SIZE * 2))) {
sub_str[... | @@ -1486,13 +1486,19 @@ int main(void)
len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
addr_p, &addr_l);
- if (len < 0 || addr.nl_pid) {
+ if (len < 0) {
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
addr.nl_pid, errno, strerror(errno));
close(fd);
return -1;
}
... | null | null | null |
14,797 | int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,
unsigned long nr_pages)
{
unsigned long i;
int err = 0;
int start_sec, end_sec;
/* during initialize mem_map, align hot-added range to section */
start_sec = pfn_to_section_nr(phys_start_pfn);
end_sec = pfn_to_section_nr(phys_start... | DoS | 0 | int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,
unsigned long nr_pages)
{
unsigned long i;
int err = 0;
int start_sec, end_sec;
/* during initialize mem_map, align hot-added range to section */
start_sec = pfn_to_section_nr(phys_start_pfn);
end_sec = pfn_to_section_nr(phys_start... | @@ -512,19 +512,20 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages;
- if (need_zonelists_rebuild)
- build_all_zonelists(NULL, zone);
- else
- zone_pcp_update(zone);
+ if (onlined_pages) {
+ node_set... | null | null | null |
14,798 | static int __meminit __add_section(int nid, struct zone *zone,
unsigned long phys_start_pfn)
{
int nr_pages = PAGES_PER_SECTION;
int ret;
if (pfn_valid(phys_start_pfn))
return -EEXIST;
ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);
if (ret < 0)
return ret;
ret = __add_zone(zone, phys_s... | DoS | 0 | static int __meminit __add_section(int nid, struct zone *zone,
unsigned long phys_start_pfn)
{
int nr_pages = PAGES_PER_SECTION;
int ret;
if (pfn_valid(phys_start_pfn))
return -EEXIST;
ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);
if (ret < 0)
return ret;
ret = __add_zone(zone, phys_s... | @@ -512,19 +512,20 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages;
- if (need_zonelists_rebuild)
- build_all_zonelists(NULL, zone);
- else
- zone_pcp_update(zone);
+ if (onlined_pages) {
+ node_set... | null | null | null |
14,799 | static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
{
struct pglist_data *pgdat = zone->zone_pgdat;
int nr_pages = PAGES_PER_SECTION;
int nid = pgdat->node_id;
int zone_type;
unsigned long flags;
zone_type = zone - pgdat->node_zones;
if (!zone->wait_table) {
int ret;
ret = init... | DoS | 0 | static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
{
struct pglist_data *pgdat = zone->zone_pgdat;
int nr_pages = PAGES_PER_SECTION;
int nid = pgdat->node_id;
int zone_type;
unsigned long flags;
zone_type = zone - pgdat->node_zones;
if (!zone->wait_table) {
int ret;
ret = init... | @@ -512,19 +512,20 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages;
- if (need_zonelists_rebuild)
- build_all_zonelists(NULL, zone);
- else
- zone_pcp_update(zone);
+ if (onlined_pages) {
+ node_set... | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.