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,500
static void print_help(void) { printf(_("Usage: %s [OPTION]...\n"), program_name); puts(_("psensor-server is an HTTP server for monitoring hardware " "sensors remotely.")); puts(""); puts("Options:"); puts(_(" -h, --help display this help and exit\n" " -v, --version display version informatio...
Dir. Trav.
0
static void print_help(void) { printf(_("Usage: %s [OPTION]...\n"), program_name); puts(_("psensor-server is an HTTP server for monitoring hardware " "sensors remotely.")); puts(""); puts("Options:"); puts(_(" -h, --help display this help and exit\n" " -v, --version display version informatio...
@@ -23,6 +23,7 @@ #include <libintl.h> #define _(str) gettext(str) +#include <limits.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -245,15 +246,25 @@ static struct MHD_Response *create_response_file(const char *nurl, static struct MHD_Response * create_response(const char *nurl, const char *...
CWE-22
null
null
14,501
static void print_version(void) { printf("psensor-server %s\n", VERSION); printf(_("Copyright (C) %s jeanfi@gmail.com\n" "License GPLv2: GNU GPL version 2 or later " "<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n" "This is free software: you are free to change and redistribute it.\n" "There is...
Dir. Trav.
0
static void print_version(void) { printf("psensor-server %s\n", VERSION); printf(_("Copyright (C) %s jeanfi@gmail.com\n" "License GPLv2: GNU GPL version 2 or later " "<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n" "This is free software: you are free to change and redistribute it.\n" "There is...
@@ -23,6 +23,7 @@ #include <libintl.h> #define _(str) gettext(str) +#include <limits.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -245,15 +246,25 @@ static struct MHD_Response *create_response_file(const char *nurl, static struct MHD_Response * create_response(const char *nurl, const char *...
CWE-22
null
null
14,502
_env_path_append(const char *env, const char *path) { char *p, *s; const char *p2; int len = 0, len2 = 0; if (!path) return; p = getenv(env); p2 = path; len2 = strlen(p2); if (p) { len = strlen(p); if ((!strcmp(p, p2)) || ((len > len2) && (!strcmp(...
+Priv
0
_env_path_append(const char *env, const char *path) { char *p, *s; const char *p2; int len = 0, len2 = 0; if (!path) return; p = getenv(env); p2 = path; len2 = strlen(p2); if (p) { len = strlen(p); if ((!strcmp(p, p2)) || ((len > len2) && (!strcmp(...
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,503
_env_path_prepend(const char *env, const char *path) { char *p, *s; const char *p2; int len = 0, len2 = 0; if (!path) return; p = getenv(env); p2 = path; len2 = strlen(p2); if (p) { len = strlen(p); if ((!strcmp(p, p2)) || ((len > len2) && (!strncm...
+Priv
0
_env_path_prepend(const char *env, const char *path) { char *p, *s; const char *p2; int len = 0, len2 = 0; if (!path) return; p = getenv(env); p2 = path; len2 = strlen(p2); if (p) { len = strlen(p); if ((!strcmp(p, p2)) || ((len > len2) && (!strncm...
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,504
_sigusr1(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { struct sigaction action; /* release ptrace */ stop_ptrace = EINA_TRUE; action.sa_sigaction = _sigusr1; action.sa_flags = SA_RESETHAND; sigemptyset(&action.sa_mask); sigaction(SIGUSR1, &action, NULL); }
+Priv
0
_sigusr1(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { struct sigaction action; /* release ptrace */ stop_ptrace = EINA_TRUE; action.sa_sigaction = _sigusr1; action.sa_flags = SA_RESETHAND; sigemptyset(&action.sa_mask); sigaction(SIGUSR1, &action, NULL); }
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,505
find_valgrind(char *path, size_t path_len) { const char *env = getenv("PATH"); while (env) { const char *p = strchr(env, ':'); ssize_t p_len; if (p) p_len = p - env; else p_len = strlen(env); if (p_len <= 0) goto next; else if (p_len + sizeof("/valgrind") >= ...
+Priv
0
find_valgrind(char *path, size_t path_len) { const char *env = getenv("PATH"); while (env) { const char *p = strchr(env, ':'); ssize_t p_len; if (p) p_len = p - env; else p_len = strlen(env); if (p_len <= 0) goto next; else if (p_len + sizeof("/valgrind") >= ...
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,506
prefix_determine(char *argv0) { pfx = eina_prefix_new(argv0, prefix_determine, "E", "enlightenment", "AUTHORS", PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, LOCALE_DIR); if (!pfx) return 0; return 1; }
+Priv
0
prefix_determine(char *argv0) { pfx = eina_prefix_new(argv0, prefix_determine, "E", "enlightenment", "AUTHORS", PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, LOCALE_DIR); if (!pfx) return 0; return 1; }
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,507
valgrind_append(char **dst, int valgrind_gdbserver, int valgrind_mode, int valgrind_tool, char *valgrind_path, const char *valgrind_log) { int i = 0; if (valgrind_tool) { dst[i++] = valgrind_path; switch (valgrind_tool) { case 1: dst[i++] = "--tool=massif"; break; ...
+Priv
0
valgrind_append(char **dst, int valgrind_gdbserver, int valgrind_mode, int valgrind_tool, char *valgrind_path, const char *valgrind_log) { int i = 0; if (valgrind_tool) { dst[i++] = valgrind_path; switch (valgrind_tool) { case 1: dst[i++] = "--tool=massif"; break; ...
@@ -567,8 +567,7 @@ main(int argc, char **argv) { /* call e_sys gdb */ snprintf(buffer, 4096, - "%s/enlightenment/utils/enlightenment_sys gdb %i %s/.e-crashdump.txt", - ...
CWE-264
null
null
14,508
auth_action_ok(char *a, gid_t gid, gid_t *gl, int gn, gid_t egid) { struct passwd *pw; struct group *gp; char *usr = NULL, **grp, *g; int ret, i, j; pw = getpwuid(uid); if (!pw) return 0; usr = pw->pw_name; if (!usr) return 0; grp =...
+Priv
0
auth_action_ok(char *a, gid_t gid, gid_t *gl, int gn, gid_t egid) { struct passwd *pw; struct group *gp; char *usr = NULL, **grp, *g; int ret, i, j; pw = getpwuid(uid); if (!pw) return 0; usr = pw->pw_name; if (!usr) return 0; grp =...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,509
auth_etc_enlightenment_sysactions(char *a, char *u, char **g) { FILE *f; char file[4096], buf[4096], id[4096], ugname[4096], perm[4096], act[4096]; char *p, *pp, *s, **gp; int ok = 0; size_t len, line = 0; int allow = 0; int deny =...
+Priv
0
auth_etc_enlightenment_sysactions(char *a, char *u, char **g) { FILE *f; char file[4096], buf[4096], id[4096], ugname[4096], perm[4096], act[4096]; char *p, *pp, *s, **gp; int ok = 0; size_t len, line = 0; int allow = 0; int deny =...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,510
auth_etc_enlightenment_sysactions_perm(char *path) { struct stat st; if (stat(path, &st) == -1) return; if ((st.st_mode & S_IWGRP) || (st.st_mode & S_IXGRP) || (st.st_mode & S_IWOTH) || (st.st_mode & S_IXOTH)) { printf("ERROR: CONFIGURATION FILE HAS BAD PERMISSIONS (writable by group ...
+Priv
0
auth_etc_enlightenment_sysactions_perm(char *path) { struct stat st; if (stat(path, &st) == -1) return; if ((st.st_mode & S_IWGRP) || (st.st_mode & S_IXGRP) || (st.st_mode & S_IWOTH) || (st.st_mode & S_IXOTH)) { printf("ERROR: CONFIGURATION FILE HAS BAD PERMISSIONS (writable by group ...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,511
check_uuid(const char *uuid) { const char *p; for (p = uuid; p[0]; p++) if ((!isalnum(*p)) && (*p != '-')) return EINA_FALSE; return EINA_TRUE; }
+Priv
0
check_uuid(const char *uuid) { const char *p; for (p = uuid; p[0]; p++) if ((!isalnum(*p)) && (*p != '-')) return EINA_FALSE; return EINA_TRUE; }
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,512
get_word(char *s, char *d) { char *p1, *p2; p1 = s; p2 = d; while (*p1) { if (p2 == d) { if (isspace(*p1)) { p1++; continue; } } if (isspace(*p1)) break; *p2 = *p1; ...
+Priv
0
get_word(char *s, char *d) { char *p1, *p2; p1 = s; p2 = d; while (*p1) { if (p2 == d) { if (isspace(*p1)) { p1++; continue; } } if (isspace(*p1)) break; *p2 = *p1; ...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,513
mount_args_check(int argc, char **argv, const char *action) { Eina_Bool opts = EINA_FALSE; struct stat st; const char *node; char buf[PATH_MAX]; if (!strcmp(action, "mount")) { /* will ALWAYS be: /path/to/mount -o nosuid,uid=XYZ,[utf8,] UUID=XXXX-XXXX[-XXXX-XXXX] /media/$devnode ...
+Priv
0
mount_args_check(int argc, char **argv, const char *action) { Eina_Bool opts = EINA_FALSE; struct stat st; const char *node; char buf[PATH_MAX]; if (!strcmp(action, "mount")) { /* will ALWAYS be: /path/to/mount -o nosuid,uid=XYZ,[utf8,] UUID=XXXX-XXXX[-XXXX-XXXX] /media/$devnode ...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,514
mountopts_check(const char *opts) { char buf[64]; const char *p; char *end; unsigned long muid; Eina_Bool nosuid, nodev, noexec, nuid; nosuid = nodev = noexec = nuid = EINA_FALSE; /* these are the only possible options which can be present here; check them strictly */ if (eina_strlcpy(buf, opt...
+Priv
0
mountopts_check(const char *opts) { char buf[64]; const char *p; char *end; unsigned long muid; Eina_Bool nosuid, nodev, noexec, nuid; nosuid = nodev = noexec = nuid = EINA_FALSE; /* these are the only possible options which can be present here; check them strictly */ if (eina_strlcpy(buf, opt...
@@ -1,5 +1,11 @@ #include "config.h" +#define __USE_MISC +#define _SVID_SOURCE +#ifdef HAVE_FEATURES_H +# include <features.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -53,7 +59,6 @@ main(int argc, const char *act; #endif gid_t gid, gl[65536], egid; - int pid = 0; f...
CWE-264
null
null
14,515
pango_glyph_string_copy (PangoGlyphString *string) { PangoGlyphString *new_string; if (string == NULL) return NULL; new_string = g_slice_new (PangoGlyphString); *new_string = *string; new_string->glyphs = g_memdup (string->glyphs, string->space * sizeof (PangoGlyphInfo)); new_string->log_clus...
DoS Exec Code Overflow
0
pango_glyph_string_copy (PangoGlyphString *string) { PangoGlyphString *new_string; if (string == NULL) return NULL; new_string = g_slice_new (PangoGlyphString); *new_string = *string; new_string->glyphs = g_memdup (string->glyphs, string->space * sizeof (PangoGlyphInfo)); new_string->log_clus...
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,516
pango_glyph_string_extents (PangoGlyphString *glyphs, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, font, ink_rect, logical_rect); }
DoS Exec Code Overflow
0
pango_glyph_string_extents (PangoGlyphString *glyphs, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, font, ink_rect, logical_rect); }
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,517
pango_glyph_string_extents_range (PangoGlyphString *glyphs, int start, int end, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { int x_pos = 0; int i; /* Note that the handling of empty rectangles for ink * and logi...
DoS Exec Code Overflow
0
pango_glyph_string_extents_range (PangoGlyphString *glyphs, int start, int end, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { int x_pos = 0; int i; /* Note that the handling of empty rectangles for ink * and logi...
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,518
pango_glyph_string_free (PangoGlyphString *string) { if (string == NULL) return; g_free (string->glyphs); g_free (string->log_clusters); g_slice_free (PangoGlyphString, string); }
DoS Exec Code Overflow
0
pango_glyph_string_free (PangoGlyphString *string) { if (string == NULL) return; g_free (string->glyphs); g_free (string->log_clusters); g_slice_free (PangoGlyphString, string); }
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,519
pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, const char *text, int length, int embedding_level, int *logical_widths) { /* Build a PangoGlyphItem so we can use PangoGlyphItemIter. * This API should have be...
DoS Exec Code Overflow
0
pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, const char *text, int length, int embedding_level, int *logical_widths) { /* Build a PangoGlyphItem so we can use PangoGlyphItemIter. * This API should have be...
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,520
pango_glyph_string_get_type (void) { static GType our_type = 0; if (G_UNLIKELY (our_type == 0)) our_type = g_boxed_type_register_static (I_("PangoGlyphString"), (GBoxedCopyFunc)pango_glyph_string_copy, (GBoxedFreeFunc)pango_glyph_string_free); return our_type; }
DoS Exec Code Overflow
0
pango_glyph_string_get_type (void) { static GType our_type = 0; if (G_UNLIKELY (our_type == 0)) our_type = g_boxed_type_register_static (I_("PangoGlyphString"), (GBoxedCopyFunc)pango_glyph_string_copy, (GBoxedFreeFunc)pango_glyph_string_free); return our_type; }
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,521
pango_glyph_string_get_width (PangoGlyphString *glyphs) { int i; int width = 0; for (i = 0; i < glyphs->num_glyphs; i++) width += glyphs->glyphs[i].geometry.width; return width; }
DoS Exec Code Overflow
0
pango_glyph_string_get_width (PangoGlyphString *glyphs) { int i; int width = 0; for (i = 0; i < glyphs->num_glyphs; i++) width += glyphs->glyphs[i].geometry.width; return width; }
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,522
pango_glyph_string_index_to_x (PangoGlyphString *glyphs, char *text, int length, PangoAnalysis *analysis, int index, gboolean trailing, int *x_pos) { int i; int start_xpos = 0; int end_xpos...
DoS Exec Code Overflow
0
pango_glyph_string_index_to_x (PangoGlyphString *glyphs, char *text, int length, PangoAnalysis *analysis, int index, gboolean trailing, int *x_pos) { int i; int start_xpos = 0; int end_xpos...
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,523
pango_glyph_string_new (void) { PangoGlyphString *string = g_slice_new (PangoGlyphString); string->num_glyphs = 0; string->space = 0; string->glyphs = NULL; string->log_clusters = NULL; return string; }
DoS Exec Code Overflow
0
pango_glyph_string_new (void) { PangoGlyphString *string = g_slice_new (PangoGlyphString); string->num_glyphs = 0; string->space = 0; string->glyphs = NULL; string->log_clusters = NULL; return string; }
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,524
pango_glyph_string_x_to_index (PangoGlyphString *glyphs, char *text, int length, PangoAnalysis *analysis, int x_pos, int *index, gboolean *trailing) { int i; int start_xpos = 0; int end_xpos...
DoS Exec Code Overflow
0
pango_glyph_string_x_to_index (PangoGlyphString *glyphs, char *text, int length, PangoAnalysis *analysis, int x_pos, int *index, gboolean *trailing) { int i; int start_xpos = 0; int end_xpos...
@@ -61,14 +61,28 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + { + string->space = 4; + } else - string->space *= 2; - - if (string->space < 0) { - g_warning ("glyph string length ...
CWE-189
null
null
14,525
_skip(conn c, int n, const char *line, int len) { /* Invert the meaning of in_job_read while throwing away data -- it * counts the bytes that remain to be thrown away. */ c->in_job = 0; c->in_job_read = n; fill_extra_data(c); if (c->in_job_read == 0) return reply(c, line, len, STATE_SENDWORD);...
Exec Code
0
_skip(conn c, int n, const char *line, int len) { /* Invert the meaning of in_job_read while throwing away data -- it * counts the bytes that remain to be thrown away. */ c->in_job = 0; c->in_job_read = n; fill_extra_data(c); if (c->in_job_read == 0) return reply(c, line, len, STATE_SENDWORD);...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,526
buried_job_p(tube t) { return job_list_any_p(&t->buried); }
Exec Code
0
buried_job_p(tube t) { return job_list_any_p(&t->buried); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,527
cmd_len(conn c) { return scan_line_end(c->cmd, c->cmd_read); }
Exec Code
0
cmd_len(conn c) { return scan_line_end(c->cmd, c->cmd_read); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,528
delay_q_take() { job j = delay_q_peek(); return j ? pq_take(&j->tube->delay) : NULL; }
Exec Code
0
delay_q_take() { job j = delay_q_peek(); return j ? pq_take(&j->tube->delay) : NULL; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,529
do_cmd(conn c) { dispatch_cmd(c); fill_extra_data(c); }
Exec Code
0
do_cmd(conn c) { dispatch_cmd(c); fill_extra_data(c); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,530
do_list_tubes(conn c, ms l) { char *buf; tube t; size_t i, resp_z; /* first, measure how big a buffer we will need */ resp_z = 6; /* initial "---\n" and final "\r\n" */ for (i = 0; i < l->used; i++) { t = l->items[i]; resp_z += 3 + strlen(t->name); /* including "- " and "\n" */ ...
Exec Code
0
do_list_tubes(conn c, ms l) { char *buf; tube t; size_t i, resp_z; /* first, measure how big a buffer we will need */ resp_z = 6; /* initial "---\n" and final "\r\n" */ for (i = 0; i < l->used; i++) { t = l->items[i]; resp_z += 3 + strlen(t->name); /* including "- " and "\n" */ ...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,531
do_stats(conn c, fmt_fn fmt, void *data) { int r, stats_len; /* first, measure how big a buffer we will need */ stats_len = fmt(NULL, 0, data) + 16; c->out_job = allocate_job(stats_len); /* fake job to hold stats data */ if (!c->out_job) return reply_serr(c, MSG_OUT_OF_MEMORY); /* Mark this j...
Exec Code
0
do_stats(conn c, fmt_fn fmt, void *data) { int r, stats_len; /* first, measure how big a buffer we will need */ stats_len = fmt(NULL, 0, data) + 16; c->out_job = allocate_job(stats_len); /* fake job to hold stats data */ if (!c->out_job) return reply_serr(c, MSG_OUT_OF_MEMORY); /* Mark this j...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,532
enqueue_job(job j, usec delay, char update_store) { int r; j->reserver = NULL; if (delay) { j->deadline_at = now_usec() + delay; r = pq_give(&j->tube->delay, j); if (!r) return 0; j->state = JOB_STATE_DELAYED; set_main_delay_timeout(); } else { r = pq_giv...
Exec Code
0
enqueue_job(job j, usec delay, char update_store) { int r; j->reserver = NULL; if (delay) { j->deadline_at = now_usec() + delay; r = pq_give(&j->tube->delay, j); if (!r) return 0; j->state = JOB_STATE_DELAYED; set_main_delay_timeout(); } else { r = pq_giv...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,533
enqueue_waiting_conn(conn c) { tube t; size_t i; global_stat.waiting_ct++; c->type |= CONN_TYPE_WAITING; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; t->stat.waiting_ct++; ms_append(&t->waiting, c); } }
Exec Code
0
enqueue_waiting_conn(conn c) { tube t; size_t i; global_stat.waiting_ct++; c->type |= CONN_TYPE_WAITING; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; t->stat.waiting_ct++; ms_append(&t->waiting, c); } }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,534
enter_drain_mode(int sig) { drain_mode = 1; }
Exec Code
0
enter_drain_mode(int sig) { drain_mode = 1; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,535
fill_extra_data(conn c) { int extra_bytes, job_data_bytes = 0, cmd_bytes; if (!c->fd) return; /* the connection was closed */ if (!c->cmd_len) return; /* we don't have a complete command */ /* how many extra bytes did we read? */ extra_bytes = c->cmd_read - c->cmd_len; /* how many bytes shoul...
Exec Code
0
fill_extra_data(conn c) { int extra_bytes, job_data_bytes = 0, cmd_bytes; if (!c->fd) return; /* the connection was closed */ if (!c->cmd_len) return; /* we don't have a complete command */ /* how many extra bytes did we read? */ extra_bytes = c->cmd_read - c->cmd_len; /* how many bytes shoul...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,536
find_reserved_job_in_conn(conn c, job j) { return (j && j->reserver == c && j->state == JOB_STATE_RESERVED) ? j : NULL; }
Exec Code
0
find_reserved_job_in_conn(conn c, job j) { return (j && j->reserver == c && j->state == JOB_STATE_RESERVED) ? j : NULL; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,537
fmt_job_stats(char *buf, size_t size, job j) { usec t; uint64_t time_left; t = now_usec(); if (j->state == JOB_STATE_RESERVED || j->state == JOB_STATE_DELAYED) { time_left = (j->deadline_at - t) / 1000000; } else { time_left = 0; } return snprintf(buf, size, STATS_JOB_FMT, ...
Exec Code
0
fmt_job_stats(char *buf, size_t size, job j) { usec t; uint64_t time_left; t = now_usec(); if (j->state == JOB_STATE_RESERVED || j->state == JOB_STATE_DELAYED) { time_left = (j->deadline_at - t) / 1000000; } else { time_left = 0; } return snprintf(buf, size, STATS_JOB_FMT, ...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,538
fmt_stats_tube(char *buf, size_t size, tube t) { uint64_t time_left; if (t->pause > 0) { time_left = (t->deadline_at - now_usec()) / 1000000; } else { time_left = 0; } return snprintf(buf, size, STATS_TUBE_FMT, t->name, t->stat.urgent_ct, t->ready...
Exec Code
0
fmt_stats_tube(char *buf, size_t size, tube t) { uint64_t time_left; if (t->pause > 0) { time_left = (t->deadline_at - now_usec()) / 1000000; } else { time_left = 0; } return snprintf(buf, size, STATS_TUBE_FMT, t->name, t->stat.urgent_ct, t->ready...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,539
get_delayed_job_ct() { tube t; size_t i; unsigned int count = 0; for (i = 0; i < tubes.used; i++) { t = tubes.items[i]; count += t->delay.used; } return count; }
Exec Code
0
get_delayed_job_ct() { tube t; size_t i; unsigned int count = 0; for (i = 0; i < tubes.used; i++) { t = tubes.items[i]; count += t->delay.used; } return count; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,540
h_accept(const int fd, const short which, struct event *ev) { conn c; int cfd, flags, r; socklen_t addrlen; struct sockaddr_in6 addr; if (which == EV_TIMEOUT) return h_delay(); addrlen = sizeof addr; cfd = accept(fd, (struct sockaddr *)&addr, &addrlen); if (cfd == -1) { if (err...
Exec Code
0
h_accept(const int fd, const short which, struct event *ev) { conn c; int cfd, flags, r; socklen_t addrlen; struct sockaddr_in6 addr; if (which == EV_TIMEOUT) return h_delay(); addrlen = sizeof addr; cfd = accept(fd, (struct sockaddr *)&addr, &addrlen); if (cfd == -1) { if (err...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,541
h_conn(const int fd, const short which, conn c) { if (fd != c->fd) { twarnx("Argh! event fd doesn't match conn fd."); close(fd); return conn_close(c); } switch (which) { case EV_TIMEOUT: h_conn_timeout(c); event_add(&c->evq, NULL); /* seems to be necessary */ ...
Exec Code
0
h_conn(const int fd, const short which, conn c) { if (fd != c->fd) { twarnx("Argh! event fd doesn't match conn fd."); close(fd); return conn_close(c); } switch (which) { case EV_TIMEOUT: h_conn_timeout(c); event_add(&c->evq, NULL); /* seems to be necessary */ ...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,542
h_conn_data(conn c) { int r, to_read; job j; struct iovec iov[2]; switch (c->state) { case STATE_WANTCOMMAND: r = read(c->fd, c->cmd + c->cmd_read, LINE_BUF_SIZE - c->cmd_read); if (r == -1) return check_err(c, "read()"); if (r == 0) return conn_close(c); /* the client hung ...
Exec Code
0
h_conn_data(conn c) { int r, to_read; job j; struct iovec iov[2]; switch (c->state) { case STATE_WANTCOMMAND: r = read(c->fd, c->cmd + c->cmd_read, LINE_BUF_SIZE - c->cmd_read); if (r == -1) return check_err(c, "read()"); if (r == 0) return conn_close(c); /* the client hung ...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,543
h_delay() { int r; job j; usec now; int i; tube t; now = now_usec(); while ((j = delay_q_peek())) { if (j->deadline_at > now) break; j = delay_q_take(); r = enqueue_job(j, 0, 0); if (r < 1) bury_job(j, 0); /* out of memory, so bury it */ } for (i = 0...
Exec Code
0
h_delay() { int r; job j; usec now; int i; tube t; now = now_usec(); while ((j = delay_q_peek())) { if (j->deadline_at > now) break; j = delay_q_take(); r = enqueue_job(j, 0, 0); if (r < 1) bury_job(j, 0); /* out of memory, so bury it */ } for (i = 0...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,544
kick_buried_job(tube t) { int r; job j; size_t z; if (!buried_job_p(t)) return 0; j = remove_buried_job(t->buried.next); z = binlog_reserve_space_update(j); if (!z) return pq_give(&t->delay, j), 0; /* put it back */ j->reserved_binlog_space += z; j->kick_ct++; r = enqueue_job(...
Exec Code
0
kick_buried_job(tube t) { int r; job j; size_t z; if (!buried_job_p(t)) return 0; j = remove_buried_job(t->buried.next); z = binlog_reserve_space_update(j); if (!z) return pq_give(&t->delay, j), 0; /* put it back */ j->reserved_binlog_space += z; j->kick_ct++; r = enqueue_job(...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,545
kick_buried_jobs(tube t, unsigned int n) { unsigned int i; for (i = 0; (i < n) && kick_buried_job(t); ++i); return i; }
Exec Code
0
kick_buried_jobs(tube t, unsigned int n) { unsigned int i; for (i = 0; (i < n) && kick_buried_job(t); ++i); return i; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,546
kick_delayed_job(tube t) { int r; job j; size_t z; j = pq_take(&t->delay); if (!j) return 0; z = binlog_reserve_space_update(j); if (!z) return pq_give(&t->delay, j), 0; /* put it back */ j->reserved_binlog_space += z; j->kick_ct++; r = enqueue_job(j, 0, 1); if (r == 1) re...
Exec Code
0
kick_delayed_job(tube t) { int r; job j; size_t z; j = pq_take(&t->delay); if (!j) return 0; z = binlog_reserve_space_update(j); if (!z) return pq_give(&t->delay, j), 0; /* put it back */ j->reserved_binlog_space += z; j->kick_ct++; r = enqueue_job(j, 0, 1); if (r == 1) re...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,547
kick_delayed_jobs(tube t, unsigned int n) { unsigned int i; for (i = 0; (i < n) && kick_delayed_job(t); ++i); return i; }
Exec Code
0
kick_delayed_jobs(tube t, unsigned int n) { unsigned int i; for (i = 0; (i < n) && kick_delayed_job(t); ++i); return i; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,548
kick_jobs(tube t, unsigned int n) { if (buried_job_p(t)) return kick_buried_jobs(t, n); return kick_delayed_jobs(t, n); }
Exec Code
0
kick_jobs(tube t, unsigned int n) { if (buried_job_p(t)) return kick_buried_jobs(t, n); return kick_delayed_jobs(t, n); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,549
maybe_enqueue_incoming_job(conn c) { job j = c->in_job; /* do we have a complete job? */ if (c->in_job_read == j->body_size) return enqueue_incoming_job(c); /* otherwise we have incomplete data, so just keep waiting */ c->state = STATE_WANTDATA; }
Exec Code
0
maybe_enqueue_incoming_job(conn c) { job j = c->in_job; /* do we have a complete job? */ if (c->in_job_read == j->body_size) return enqueue_incoming_job(c); /* otherwise we have incomplete data, so just keep waiting */ c->state = STATE_WANTDATA; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,550
name_is_ok(const char *name, size_t max) { size_t len = strlen(name); return len > 0 && len <= max && strspn(name, NAME_CHARS) == len && name[0] != '-'; }
Exec Code
0
name_is_ok(const char *name, size_t max) { size_t len = strlen(name); return len > 0 && len <= max && strspn(name, NAME_CHARS) == len && name[0] != '-'; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,551
next_eligible_job(usec now) { tube t; size_t i; job j = NULL, candidate; dprintf("tubes.used = %zu\n", tubes.used); for (i = 0; i < tubes.used; i++) { t = tubes.items[i]; dprintf("for %s t->waiting.used=%zu t->ready.used=%d t->pause=%" PRIu64 "\n", t->name, t->waitin...
Exec Code
0
next_eligible_job(usec now) { tube t; size_t i; job j = NULL, candidate; dprintf("tubes.used = %zu\n", tubes.used); for (i = 0; i < tubes.used; i++) { t = tubes.items[i]; dprintf("for %s t->waiting.used=%zu t->ready.used=%d t->pause=%" PRIu64 "\n", t->name, t->waitin...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,552
peek_job(uint64_t id) { return job_find(id); }
Exec Code
0
peek_job(uint64_t id) { return job_find(id); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,553
process_queue() { job j; usec now = now_usec(); dprintf("processing queue\n"); while ((j = next_eligible_job(now))) { dprintf("got eligible job %llu in %s\n", j->id, j->tube->name); j = pq_take(&j->tube->ready); ready_ct--; if (j->pri < URGENT_THRESHOLD) { gl...
Exec Code
0
process_queue() { job j; usec now = now_usec(); dprintf("processing queue\n"); while ((j = next_eligible_job(now))) { dprintf("got eligible job %llu in %s\n", j->id, j->tube->name); j = pq_take(&j->tube->ready); ready_ct--; if (j->pri < URGENT_THRESHOLD) { gl...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,554
prot_init() { started_at = now_usec(); memset(op_ct, 0, sizeof(op_ct)); ms_init(&tubes, NULL, NULL); TUBE_ASSIGN(default_tube, tube_find_or_make("default")); if (!default_tube) twarnx("Out of memory during startup!"); }
Exec Code
0
prot_init() { started_at = now_usec(); memset(op_ct, 0, sizeof(op_ct)); ms_init(&tubes, NULL, NULL); TUBE_ASSIGN(default_tube, tube_find_or_make("default")); if (!default_tube) twarnx("Out of memory during startup!"); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,555
prot_remove_tube(tube t) { ms_remove(&tubes, t); }
Exec Code
0
prot_remove_tube(tube t) { ms_remove(&tubes, t); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,556
prot_replay_binlog(job binlog_jobs) { job j, nj; usec delay; int r; for (j = binlog_jobs->next ; j != binlog_jobs ; j = nj) { nj = j->next; job_remove(j); binlog_reserve_space_update(j); /* reserve space for a delete */ delay = 0; switch (j->state) { case...
Exec Code
0
prot_replay_binlog(job binlog_jobs) { job j, nj; usec delay; int r; for (j = binlog_jobs->next ; j != binlog_jobs ; j = nj) { nj = j->next; job_remove(j); binlog_reserve_space_update(j); /* reserve space for a delete */ delay = 0; switch (j->state) { case...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,557
read_delay(usec *delay, const char *buf, char **end) { int r; unsigned int delay_sec; r = read_pri(&delay_sec, buf, end); if (r) return r; *delay = ((usec) delay_sec) * 1000000; return 0; }
Exec Code
0
read_delay(usec *delay, const char *buf, char **end) { int r; unsigned int delay_sec; r = read_pri(&delay_sec, buf, end); if (r) return r; *delay = ((usec) delay_sec) * 1000000; return 0; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,558
read_pri(unsigned int *pri, const char *buf, char **end) { char *tend; unsigned int tpri; errno = 0; while (buf[0] == ' ') buf++; if (!isdigit(buf[0])) return -1; tpri = strtoul(buf, &tend, 10); if (tend == buf) return -1; if (errno && errno != ERANGE) return -1; if (!end && tend[0]...
Exec Code
0
read_pri(unsigned int *pri, const char *buf, char **end) { char *tend; unsigned int tpri; errno = 0; while (buf[0] == ' ') buf++; if (!isdigit(buf[0])) return -1; tpri = strtoul(buf, &tend, 10); if (tend == buf) return -1; if (errno && errno != ERANGE) return -1; if (!end && tend[0]...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,559
read_ttr(usec *ttr, const char *buf, char **end) { return read_delay(ttr, buf, end); }
Exec Code
0
read_ttr(usec *ttr, const char *buf, char **end) { return read_delay(ttr, buf, end); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,560
read_tube_name(char **tubename, char *buf, char **end) { size_t len; while (buf[0] == ' ') buf++; len = strspn(buf, NAME_CHARS); if (len == 0) return -1; if (tubename) *tubename = buf; if (end) *end = buf + len; return 0; }
Exec Code
0
read_tube_name(char **tubename, char *buf, char **end) { size_t len; while (buf[0] == ' ') buf++; len = strspn(buf, NAME_CHARS); if (len == 0) return -1; if (tubename) *tubename = buf; if (end) *end = buf + len; return 0; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,561
remove_buried_job(job j) { if (!j || j->state != JOB_STATE_BURIED) return NULL; j = job_remove(j); if (j) { global_stat.buried_ct--; j->tube->stat.buried_ct--; } return j; }
Exec Code
0
remove_buried_job(job j) { if (!j || j->state != JOB_STATE_BURIED) return NULL; j = job_remove(j); if (j) { global_stat.buried_ct--; j->tube->stat.buried_ct--; } return j; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,562
remove_ready_job(job j) { if (!j || j->state != JOB_STATE_READY) return NULL; j = pq_remove(&j->tube->ready, j); if (j) { ready_ct--; if (j->pri < URGENT_THRESHOLD) { global_stat.urgent_ct--; j->tube->stat.urgent_ct--; } } return j; }
Exec Code
0
remove_ready_job(job j) { if (!j || j->state != JOB_STATE_READY) return NULL; j = pq_remove(&j->tube->ready, j); if (j) { ready_ct--; if (j->pri < URGENT_THRESHOLD) { global_stat.urgent_ct--; j->tube->stat.urgent_ct--; } } return j; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,563
remove_reserved_job(conn c, job j) { return remove_this_reserved_job(c, find_reserved_job_in_conn(c, j)); }
Exec Code
0
remove_reserved_job(conn c, job j) { return remove_this_reserved_job(c, find_reserved_job_in_conn(c, j)); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,564
remove_waiting_conn(conn c) { tube t; size_t i; if (!conn_waiting(c)) return NULL; c->type &= ~CONN_TYPE_WAITING; global_stat.waiting_ct--; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; t->stat.waiting_ct--; ms_remove(&t->waiting, c); } return c; ...
Exec Code
0
remove_waiting_conn(conn c) { tube t; size_t i; if (!conn_waiting(c)) return NULL; c->type &= ~CONN_TYPE_WAITING; global_stat.waiting_ct--; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; t->stat.waiting_ct--; ms_remove(&t->waiting, c); } return c; ...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,565
reset_conn(conn c) { int r; r = conn_update_evq(c, EV_READ | EV_PERSIST); if (r == -1) return twarnx("update events failed"), conn_close(c); /* was this a peek or stats command? */ if (c->out_job && c->out_job->state == JOB_STATE_COPY) job_free(c->out_job); c->out_job = NULL; c->reply_sen...
Exec Code
0
reset_conn(conn c) { int r; r = conn_update_evq(c, EV_READ | EV_PERSIST); if (r == -1) return twarnx("update events failed"), conn_close(c); /* was this a peek or stats command? */ if (c->out_job && c->out_job->state == JOB_STATE_COPY) job_free(c->out_job); c->out_job = NULL; c->reply_sen...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,566
scan_line_end(const char *s, int size) { char *match; match = memchr(s, '\r', size - 1); if (!match) return 0; /* this is safe because we only scan size - 1 chars above */ if (match[1] == '\n') return match - s + 2; return 0; }
Exec Code
0
scan_line_end(const char *s, int size) { char *match; match = memchr(s, '\r', size - 1); if (!match) return 0; /* this is safe because we only scan size - 1 chars above */ if (match[1] == '\n') return match - s + 2; return 0; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,567
set_main_delay_timeout() { job j = delay_q_peek(); tube t = pause_tube_peek(); usec deadline_at = t ? t->deadline_at : 0; if (j && (!deadline_at || j->deadline_at < deadline_at)) deadline_at = j->deadline_at; dprintf("deadline_at=%" PRIu64 "\n", deadline_at); set_main_timeout(deadline_at); }
Exec Code
0
set_main_delay_timeout() { job j = delay_q_peek(); tube t = pause_tube_peek(); usec deadline_at = t ? t->deadline_at : 0; if (j && (!deadline_at || j->deadline_at < deadline_at)) deadline_at = j->deadline_at; dprintf("deadline_at=%" PRIu64 "\n", deadline_at); set_main_timeout(deadline_at); }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,568
touch_job(conn c, job j) { j = find_reserved_job_in_conn(c, j); if (j) { j->deadline_at = now_usec() + j->ttr; c->soonest_job = NULL; } return j; }
Exec Code
0
touch_job(conn c, job j) { j = find_reserved_job_in_conn(c, j); if (j) { j->deadline_at = now_usec() + j->ttr; c->soonest_job = NULL; } return j; }
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,569
wait_for_job(conn c, int timeout) { int r; c->state = STATE_WAIT; enqueue_waiting_conn(c); /* Set the pending timeout to the requested timeout amount */ c->pending_timeout = timeout; /* this conn is waiting, but we want to know if they hang up */ r = conn_update_evq(c, EV_READ | EV_PERSIS...
Exec Code
0
wait_for_job(conn c, int timeout) { int r; c->state = STATE_WAIT; enqueue_waiting_conn(c); /* Set the pending timeout to the requested timeout amount */ c->pending_timeout = timeout; /* this conn is waiting, but we want to know if they hang up */ r = conn_update_evq(c, EV_READ | EV_PERSIS...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,570
which_cmd(conn c) { #define TEST_CMD(s,c,o) if (strncmp((s), (c), CONSTSTRLEN(c)) == 0) return (o); TEST_CMD(c->cmd, CMD_PUT, OP_PUT); TEST_CMD(c->cmd, CMD_PEEKJOB, OP_PEEKJOB); TEST_CMD(c->cmd, CMD_PEEK_READY, OP_PEEK_READY); TEST_CMD(c->cmd, CMD_PEEK_DELAYED, OP_PEEK_DELAYED); TEST_CMD(c->cmd, CMD...
Exec Code
0
which_cmd(conn c) { #define TEST_CMD(s,c,o) if (strncmp((s), (c), CONSTSTRLEN(c)) == 0) return (o); TEST_CMD(c->cmd, CMD_PUT, OP_PUT); TEST_CMD(c->cmd, CMD_PEEKJOB, OP_PEEKJOB); TEST_CMD(c->cmd, CMD_PEEK_READY, OP_PEEK_READY); TEST_CMD(c->cmd, CMD_PEEK_DELAYED, OP_PEEK_DELAYED); TEST_CMD(c->cmd, CMD...
@@ -1196,7 +1196,8 @@ dispatch_cmd(conn c) if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { - return reply_msg(c, MSG_JOB_TOO_BIG); + /* throw away the job body and respond with JOB_TOO_BIG */ + return skip(c, body_size + 2, MSG_...
null
null
null
14,571
static GIOStatus irssi_ssl_close(GIOChannel *handle, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_close(handle, gerr); }
null
0
static GIOStatus irssi_ssl_close(GIOChannel *handle, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_close(handle, gerr); }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,572
static GIOFlags irssi_ssl_get_flags(GIOChannel *handle) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_get_flags(handle); }
null
0
static GIOFlags irssi_ssl_get_flags(GIOChannel *handle) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_get_flags(handle); }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,573
static gboolean irssi_ssl_init(void) { SSL_library_init(); SSL_load_error_strings(); ssl_ctx = SSL_CTX_new(SSLv23_client_method()); if(!ssl_ctx) { g_error("Initialization of the SSL library failed"); return FALSE; } return TRUE; }
null
0
static gboolean irssi_ssl_init(void) { SSL_library_init(); SSL_load_error_strings(); ssl_ctx = SSL_CTX_new(SSLv23_client_method()); if(!ssl_ctx) { g_error("Initialization of the SSL library failed"); return FALSE; } return TRUE; }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,574
static GIOStatus irssi_ssl_read(GIOChannel *handle, gchar *buf, gsize len, gsize *ret, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; gint ret1, err; const char *errstr; ret1 = SSL_read(chan->ssl, buf, len); if(ret1 <= 0) { *ret = 0; err = SSL_get_error(chan->ssl, ret1); if(err == SSL_ERRO...
null
0
static GIOStatus irssi_ssl_read(GIOChannel *handle, gchar *buf, gsize len, gsize *ret, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; gint ret1, err; const char *errstr; ret1 = SSL_read(chan->ssl, buf, len); if(ret1 <= 0) { *ret = 0; err = SSL_get_error(chan->ssl, ret1); if(err == SSL_ERRO...
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,575
static GIOStatus irssi_ssl_seek(GIOChannel *handle, gint64 offset, GSeekType type, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_seek(handle, offset, type, gerr); }
null
0
static GIOStatus irssi_ssl_seek(GIOChannel *handle, gint64 offset, GSeekType type, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_seek(handle, offset, type, gerr); }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,576
static GIOStatus irssi_ssl_set_flags(GIOChannel *handle, GIOFlags flags, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_set_flags(handle, flags, gerr); }
null
0
static GIOStatus irssi_ssl_set_flags(GIOChannel *handle, GIOFlags flags, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; return chan->giochan->funcs->io_set_flags(handle, flags, gerr); }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,577
static GIOStatus irssi_ssl_write(GIOChannel *handle, const gchar *buf, gsize len, gsize *ret, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; gint ret1, err; const char *errstr; ret1 = SSL_write(chan->ssl, (const char *)buf, len); if(ret1 <= 0) { *ret = 0; err = SSL_get_error(chan->ssl, ret1)...
null
0
static GIOStatus irssi_ssl_write(GIOChannel *handle, const gchar *buf, gsize len, gsize *ret, GError **gerr) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; gint ret1, err; const char *errstr; ret1 = SSL_write(chan->ssl, (const char *)buf, len); if(ret1 <= 0) { *ret = 0; err = SSL_get_error(chan->ssl, ret1)...
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,578
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) { g_warning("Connection failed: SSL support not enabled in this build."); errno = ENOSYS; return NULL; }
null
0
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) { g_warning("Connection failed: SSL support not enabled in this build."); errno = ENOSYS; return NULL; }
@@ -26,6 +26,7 @@ #include <openssl/crypto.h> #include <openssl/x509.h> +#include <openssl/x509v3.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -39,6 +40,7 @@ typedef struct SSL *ssl; SSL_CTX *ctx; unsigned int verify:1; + const char *hostname; } GIOSSLChannel; static...
CWE-20
null
null
14,579
SERVER_REC *cmd_options_get_server(const char *cmd, GHashTable *optlist, SERVER_REC *defserver) { SERVER_REC *server; GSList *list, *tmp, *next; /* get all the options, then remove the known ones. there should be only one left - the server tag. */ list = hashtable_get_keys(optlist); if (cmd != N...
null
0
SERVER_REC *cmd_options_get_server(const char *cmd, GHashTable *optlist, SERVER_REC *defserver) { SERVER_REC *server; GSList *list, *tmp, *next; /* get all the options, then remove the known ones. there should be only one left - the server tag. */ list = hashtable_get_keys(optlist); if (cmd != N...
@@ -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,580
static void disconnect_servers(GSList *servers, int chat_type) { GSList *tmp, *next; for (tmp = servers; tmp != NULL; tmp = next) { SERVER_REC *rec = tmp->data; next = tmp->next; if (rec->chat_type == chat_type) server_disconnect(rec); } }
null
0
static void disconnect_servers(GSList *servers, int chat_type) { GSList *tmp, *next; for (tmp = servers; tmp != NULL; tmp = next) { SERVER_REC *rec = tmp->data; next = tmp->next; if (rec->chat_type == chat_type) server_disconnect(rec); } }
@@ -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,581
void server_change_nick(SERVER_REC *server, const char *nick) { g_free(server->nick); server->nick = g_strdup(nick); signal_emit("server nick changed", 1, server); }
null
0
void server_change_nick(SERVER_REC *server, const char *nick) { g_free(server->nick); server->nick = g_strdup(nick); signal_emit("server nick changed", 1, server); }
@@ -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,582
SERVER_REC *server_connect(SERVER_CONNECT_REC *conn) { CHAT_PROTOCOL_REC *proto; SERVER_REC *server; proto = CHAT_PROTOCOL(conn); server = proto->server_init_connect(conn); proto->server_connect(server); return server; }
null
0
SERVER_REC *server_connect(SERVER_CONNECT_REC *conn) { CHAT_PROTOCOL_REC *proto; SERVER_REC *server; proto = CHAT_PROTOCOL(conn); server = proto->server_init_connect(conn); proto->server_connect(server); return server; }
@@ -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,583
static void server_connect_callback_init(SERVER_REC *server, GIOChannel *handle) { int error; g_return_if_fail(IS_SERVER(server)); error = net_geterror(handle); if (error != 0) { server->connection_lost = TRUE; server_connect_failed(server, g_strerror(error)); return; } lookup_servers = g_slist_remove(lo...
null
0
static void server_connect_callback_init(SERVER_REC *server, GIOChannel *handle) { int error; g_return_if_fail(IS_SERVER(server)); error = net_geterror(handle); if (error != 0) { server->connection_lost = TRUE; server_connect_failed(server, g_strerror(error)); return; } lookup_servers = g_slist_remove(lo...
@@ -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,584
static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *handle) { int error; g_return_if_fail(IS_SERVER(server)); error = irssi_ssl_handshake(handle); if (error == -1) { server->connection_lost = TRUE; server_connect_failed(server, NULL); return; } if (error & 1) { if (server->conne...
null
0
static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *handle) { int error; g_return_if_fail(IS_SERVER(server)); error = irssi_ssl_handshake(handle); if (error == -1) { server->connection_lost = TRUE; server_connect_failed(server, NULL); return; } if (error & 1) { if (server->conne...
@@ -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,585
static void server_connect_callback_readpipe(SERVER_REC *server) { RESOLVED_IP_REC iprec; IPADDR *ip; const char *errormsg; char *servername = NULL; g_source_remove(server->connect_tag); server->connect_tag = -1; net_gethostbyname_return(server->connect_pipe[0], &iprec); g_io_channel_close(server->con...
null
0
static void server_connect_callback_readpipe(SERVER_REC *server) { RESOLVED_IP_REC iprec; IPADDR *ip; const char *errormsg; char *servername = NULL; g_source_remove(server->connect_tag); server->connect_tag = -1; net_gethostbyname_return(server->connect_pipe[0], &iprec); g_io_channel_close(server->con...
@@ -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,586
void server_connect_finished(SERVER_REC *server) { server->connect_time = time(NULL); servers = g_slist_append(servers, server); signal_emit("server connected", 1, server); }
null
0
void server_connect_finished(SERVER_REC *server) { server->connect_time = time(NULL); servers = g_slist_append(servers, server); signal_emit("server connected", 1, server); }
@@ -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,587
void server_connect_init(SERVER_REC *server) { const char *str; g_return_if_fail(server != NULL); MODULE_DATA_INIT(server); server->type = module_get_uniq_id("SERVER", 0); server_ref(server); server->nick = g_strdup(server->connrec->nick); if (server->connrec->username == NULL || *server->connrec->username ==...
null
0
void server_connect_init(SERVER_REC *server) { const char *str; g_return_if_fail(server != NULL); MODULE_DATA_INIT(server); server->type = module_get_uniq_id("SERVER", 0); server_ref(server); server->nick = g_strdup(server->connrec->nick); if (server->connrec->username == NULL || *server->connrec->username ==...
@@ -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,588
void server_connect_own_ip_save(SERVER_CONNECT_REC *conn, IPADDR *ip4, IPADDR *ip6) { if (ip4 == NULL || ip4->family == 0) g_free_and_null(conn->own_ip4); if (ip6 == NULL || ip6->family == 0) g_free_and_null(conn->own_ip6); if (ip4 != NULL && ip4->family != 0) { /* IPv4 address was found */ if (conn->ow...
null
0
void server_connect_own_ip_save(SERVER_CONNECT_REC *conn, IPADDR *ip4, IPADDR *ip6) { if (ip4 == NULL || ip4->family == 0) g_free_and_null(conn->own_ip4); if (ip6 == NULL || ip6->family == 0) g_free_and_null(conn->own_ip6); if (ip4 != NULL && ip4->family != 0) { /* IPv4 address was found */ if (conn->ow...
@@ -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,589
void server_connect_unref(SERVER_CONNECT_REC *conn) { g_return_if_fail(IS_SERVER_CONNECT(conn)); if (--conn->refcount > 0) return; if (conn->refcount < 0) { g_warning("Connection '%s' refcount = %d", conn->tag, conn->refcount); } CHAT_PROTOCOL(conn)->destroy_server_connect(conn); if (conn->conn...
null
0
void server_connect_unref(SERVER_CONNECT_REC *conn) { g_return_if_fail(IS_SERVER_CONNECT(conn)); if (--conn->refcount > 0) return; if (conn->refcount < 0) { g_warning("Connection '%s' refcount = %d", conn->tag, conn->refcount); } CHAT_PROTOCOL(conn)->destroy_server_connect(conn); if (conn->conn...
@@ -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,590
static char *server_create_address_tag(const char *address) { const char *start, *end; g_return_val_if_fail(address != NULL, NULL); /* try to generate a reasonable server tag */ if (strchr(address, '.') == NULL) { start = end = NULL; } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || g_ascii_strnca...
null
0
static char *server_create_address_tag(const char *address) { const char *start, *end; g_return_val_if_fail(address != NULL, NULL); /* try to generate a reasonable server tag */ if (strchr(address, '.') == NULL) { start = end = NULL; } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || g_ascii_strnca...
@@ -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,591
static char *server_create_tag(SERVER_CONNECT_REC *conn) { GString *str; char *tag; int num; g_return_val_if_fail(IS_SERVER_CONNECT(conn), NULL); tag = conn->chatnet != NULL && *conn->chatnet != '\0' ? g_strdup(conn->chatnet) : server_create_address_tag(conn->address); if (conn->tag != NULL && server_find_...
null
0
static char *server_create_tag(SERVER_CONNECT_REC *conn) { GString *str; char *tag; int num; g_return_val_if_fail(IS_SERVER_CONNECT(conn), NULL); tag = conn->chatnet != NULL && *conn->chatnet != '\0' ? g_strdup(conn->chatnet) : server_create_address_tag(conn->address); if (conn->tag != NULL && server_find_...
@@ -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,592
void server_disconnect(SERVER_REC *server) { int chans; g_return_if_fail(IS_SERVER(server)); if (server->disconnected) return; if (server->connect_tag != -1) { /* still connecting to server.. */ if (server->connect_pid != -1) net_disconnect_nonblock(server->connect_pid); server_connect_failed(server, ...
null
0
void server_disconnect(SERVER_REC *server) { int chans; g_return_if_fail(IS_SERVER(server)); if (server->disconnected) return; if (server->connect_tag != -1) { /* still connecting to server.. */ if (server->connect_pid != -1) net_disconnect_nonblock(server->connect_pid); server_connect_failed(server, ...
@@ -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,593
SERVER_REC *server_find_chatnet(const char *chatnet) { GSList *tmp; g_return_val_if_fail(chatnet != NULL, NULL); if (*chatnet == '\0') return NULL; for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (server->connrec->chatnet != NULL && g_strcasecmp(server->connrec->c...
null
0
SERVER_REC *server_find_chatnet(const char *chatnet) { GSList *tmp; g_return_val_if_fail(chatnet != NULL, NULL); if (*chatnet == '\0') return NULL; for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (server->connrec->chatnet != NULL && g_strcasecmp(server->connrec->c...
@@ -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,594
SERVER_REC *server_find_lookup_tag(const char *tag) { GSList *tmp; g_return_val_if_fail(tag != NULL, NULL); if (*tag == '\0') return NULL; for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (g_strcasecmp(server->tag, tag) == 0) return server; } return NULL; }
null
0
SERVER_REC *server_find_lookup_tag(const char *tag) { GSList *tmp; g_return_val_if_fail(tag != NULL, NULL); if (*tag == '\0') return NULL; for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (g_strcasecmp(server->tag, tag) == 0) return server; } return NULL; }
@@ -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,595
SERVER_REC *server_find_tag(const char *tag) { GSList *tmp; g_return_val_if_fail(tag != NULL, NULL); if (*tag == '\0') return NULL; for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (g_strcasecmp(server->tag, tag) == 0) return server; } return NULL; }
null
0
SERVER_REC *server_find_tag(const char *tag) { GSList *tmp; g_return_val_if_fail(tag != NULL, NULL); if (*tag == '\0') return NULL; for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *server = tmp->data; if (g_strcasecmp(server->tag, tag) == 0) return server; } return NULL; }
@@ -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,596
void server_ref(SERVER_REC *server) { g_return_if_fail(IS_SERVER(server)); server->refcount++; }
null
0
void server_ref(SERVER_REC *server) { g_return_if_fail(IS_SERVER(server)); server->refcount++; }
@@ -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,597
int server_start_connect(SERVER_REC *server) { const char *connect_address; int fd[2]; g_return_val_if_fail(server != NULL, FALSE); if (!server->connrec->unix_socket && server->connrec->port <= 0) return FALSE; server->rawlog = rawlog_create(); if (server->connrec->connect_handle != NULL) { /* alrea...
null
0
int server_start_connect(SERVER_REC *server) { const char *connect_address; int fd[2]; g_return_val_if_fail(server != NULL, FALSE); if (!server->connrec->unix_socket && server->connrec->port <= 0) return FALSE; server->rawlog = rawlog_create(); if (server->connrec->connect_handle != NULL) { /* alrea...
@@ -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,598
int server_unref(SERVER_REC *server) { g_return_val_if_fail(IS_SERVER(server), FALSE); if (--server->refcount > 0) return TRUE; if (g_slist_find(servers, server) != NULL) { g_warning("Non-referenced server wasn't disconnected"); server_disconnect(server); return TRUE; } MODULE_DATA_DEINIT(server)...
null
0
int server_unref(SERVER_REC *server) { g_return_val_if_fail(IS_SERVER(server), FALSE); if (--server->refcount > 0) return TRUE; if (g_slist_find(servers, server) != NULL) { g_warning("Non-referenced server wasn't disconnected"); server_disconnect(server); return TRUE; } MODULE_DATA_DEINIT(server)...
@@ -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,599
void servers_deinit(void) { signal_remove("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit); servers_setup_deinit(); servers_reconnect_deinit(); module_uniq_destroy("SERVER"); module_uniq_destroy("SERVER CONNECT"); }
null
0
void servers_deinit(void) { signal_remove("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit); servers_setup_deinit(); servers_reconnect_deinit(); module_uniq_destroy("SERVER"); module_uniq_destroy("SERVER CONNECT"); }
@@ -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