idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
5,100 | MenuCacheDir* menu_cache_get_dir_from_path( MenuCache* cache, const char* path )
{
char** names = g_strsplit( path + 1, "/", -1 );
int i = 0;
MenuCacheDir* dir = NULL;
if( !names )
return NULL;
if( G_UNLIKELY(!names[0]) )
{
g_strfreev(names);
return NULL;
}
/* t... | DoS | 0 | MenuCacheDir* menu_cache_get_dir_from_path( MenuCache* cache, const char* path )
{
char** names = g_strsplit( path + 1, "/", -1 );
int i = 0;
MenuCacheDir* dir = NULL;
if( !names )
return NULL;
if( G_UNLIKELY(!names[0]) )
{
g_strfreev(names);
return NULL;
}
/* t... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,101 | MenuCacheDir* menu_cache_get_root_dir( MenuCache* cache )
{
MenuCacheDir* dir = menu_cache_dup_root_dir(cache);
/* NOTE: this is very ugly hack but cache->root_dir may be changed by
cache reload in server-io thread, so we should keep it alive :( */
if(dir)
g_timeout_add_seconds(10, (GSourceFu... | DoS | 0 | MenuCacheDir* menu_cache_get_root_dir( MenuCache* cache )
{
MenuCacheDir* dir = menu_cache_dup_root_dir(cache);
/* NOTE: this is very ugly hack but cache->root_dir may be changed by
cache reload in server-io thread, so we should keep it alive :( */
if(dir)
g_timeout_add_seconds(10, (GSourceFu... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,102 | void menu_cache_init(int flags)
{
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
}
| DoS | 0 | void menu_cache_init(int flags)
{
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,103 | MenuCacheDir* menu_cache_item_dup_parent( MenuCacheItem* item )
{
MenuCacheDir* dir;
MENU_CACHE_LOCK;
dir = item->parent;
if(G_LIKELY(dir))
menu_cache_item_ref(MENU_CACHE_ITEM(dir));
MENU_CACHE_UNLOCK;
return dir;
}
| DoS | 0 | MenuCacheDir* menu_cache_item_dup_parent( MenuCacheItem* item )
{
MenuCacheDir* dir;
MENU_CACHE_LOCK;
dir = item->parent;
if(G_LIKELY(dir))
menu_cache_item_ref(MENU_CACHE_ITEM(dir));
MENU_CACHE_UNLOCK;
return dir;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,104 | const char* menu_cache_item_get_comment( MenuCacheItem* item )
{
return item->comment;
}
| DoS | 0 | const char* menu_cache_item_get_comment( MenuCacheItem* item )
{
return item->comment;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,105 | const char* menu_cache_item_get_file_basename( MenuCacheItem* item )
{
return item->file_name;
}
| DoS | 0 | const char* menu_cache_item_get_file_basename( MenuCacheItem* item )
{
return item->file_name;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,106 | const char* menu_cache_item_get_file_dirname( MenuCacheItem* item )
{
return item->file_dir ? item->file_dir->dir + 1 : NULL;
}
| DoS | 0 | const char* menu_cache_item_get_file_dirname( MenuCacheItem* item )
{
return item->file_dir ? item->file_dir->dir + 1 : NULL;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,107 | char* menu_cache_item_get_file_path( MenuCacheItem* item )
{
if( ! item->file_name || ! item->file_dir )
return NULL;
return g_build_filename( item->file_dir->dir + 1, item->file_name, NULL );
}
| DoS | 0 | char* menu_cache_item_get_file_path( MenuCacheItem* item )
{
if( ! item->file_name || ! item->file_dir )
return NULL;
return g_build_filename( item->file_dir->dir + 1, item->file_name, NULL );
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,108 | const char* menu_cache_item_get_icon( MenuCacheItem* item )
{
return item->icon;
}
| DoS | 0 | const char* menu_cache_item_get_icon( MenuCacheItem* item )
{
return item->icon;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,109 | const char* menu_cache_item_get_id( MenuCacheItem* item )
{
return item->id;
}
| DoS | 0 | const char* menu_cache_item_get_id( MenuCacheItem* item )
{
return item->id;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,110 | const char* menu_cache_item_get_name( MenuCacheItem* item )
{
return item->name;
}
| DoS | 0 | const char* menu_cache_item_get_name( MenuCacheItem* item )
{
return item->name;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,111 | MenuCacheType menu_cache_item_get_type( MenuCacheItem* item )
{
return item->type;
}
| DoS | 0 | MenuCacheType menu_cache_item_get_type( MenuCacheItem* item )
{
return item->type;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,112 | MenuCacheItem* menu_cache_item_ref(MenuCacheItem* item)
{
g_atomic_int_inc( &item->n_ref );
/* DEBUG("item_ref %s: %d -> %d", item->id, item->n_ref-1, item->n_ref); */
return item;
}
| DoS | 0 | MenuCacheItem* menu_cache_item_ref(MenuCacheItem* item)
{
g_atomic_int_inc( &item->n_ref );
/* DEBUG("item_ref %s: %d -> %d", item->id, item->n_ref-1, item->n_ref); */
return item;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,113 | MenuCache* menu_cache_ref(MenuCache* cache)
{
g_atomic_int_inc( &cache->n_ref );
return cache;
}
| DoS | 0 | MenuCache* menu_cache_ref(MenuCache* cache)
{
g_atomic_int_inc( &cache->n_ref );
return cache;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,114 | gboolean menu_cache_reload( MenuCache* cache )
{
char* line;
gsize len;
GFile* file;
GFileInputStream* istr = NULL;
GDataInputStream* f;
MenuCacheFileDir** all_used_files;
int i, n;
int ver_maj, ver_min;
MENU_CACHE_LOCK;
if (cache->reload_id)
g_source_remove(cache->reloa... | DoS | 0 | gboolean menu_cache_reload( MenuCache* cache )
{
char* line;
gsize len;
GFile* file;
GFileInputStream* istr = NULL;
GDataInputStream* f;
MenuCacheFileDir** all_used_files;
int i, n;
int ver_maj, ver_min;
MENU_CACHE_LOCK;
if (cache->reload_id)
g_source_remove(cache->reloa... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,115 | static gboolean menu_cache_reload_idle(gpointer cache)
{
/* do reload once */
if (!g_source_is_destroyed(g_main_current_source()))
menu_cache_reload(cache);
return FALSE;
}
| DoS | 0 | static gboolean menu_cache_reload_idle(gpointer cache)
{
/* do reload once */
if (!g_source_is_destroyed(g_main_current_source()))
menu_cache_reload(cache);
return FALSE;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,116 | void menu_cache_remove_reload_notify(MenuCache* cache, MenuCacheNotifyId notify_id)
{
MENU_CACHE_LOCK;
g_slice_free( CacheReloadNotifier, ((GSList*)notify_id)->data );
cache->notifiers = g_slist_delete_link( cache->notifiers, (GSList*)notify_id );
MENU_CACHE_UNLOCK;
}
| DoS | 0 | void menu_cache_remove_reload_notify(MenuCache* cache, MenuCacheNotifyId notify_id)
{
MENU_CACHE_LOCK;
g_slice_free( CacheReloadNotifier, ((GSList*)notify_id)->data );
cache->notifiers = g_slist_delete_link( cache->notifiers, (GSList*)notify_id );
MENU_CACHE_UNLOCK;
}
| @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,117 | void menu_cache_unref(MenuCache* cache)
{
/* DEBUG("cache_unref: %d", cache->n_ref); */
/* we need a lock here unfortunately because item in hash isn't protected
by reference therefore another thread may get access to it right now */
MENU_CACHE_LOCK;
if( g_atomic_int_dec_and_test(&cache->n_ref) )... | DoS | 0 | void menu_cache_unref(MenuCache* cache)
{
/* DEBUG("cache_unref: %d", cache->n_ref); */
/* we need a lock here unfortunately because item in hash isn't protected
by reference therefore another thread may get access to it right now */
MENU_CACHE_LOCK;
if( g_atomic_int_dec_and_test(&cache->n_ref) )... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,118 | static void read_app(GDataInputStream* f, MenuCacheApp* app, MenuCache* cache)
{
char *line;
gsize len;
GString *str;
/* generic name */
line = g_data_input_stream_read_line(f, &len, cache->cancellable, NULL);
if(G_UNLIKELY(line == NULL))
return;
if(G_LIKELY(len > 0))
app->g... | DoS | 0 | static void read_app(GDataInputStream* f, MenuCacheApp* app, MenuCache* cache)
{
char *line;
gsize len;
GString *str;
/* generic name */
line = g_data_input_stream_read_line(f, &len, cache->cancellable, NULL);
if(G_UNLIKELY(line == NULL))
return;
if(G_LIKELY(len > 0))
app->g... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,119 | static void read_dir(GDataInputStream* f, MenuCacheDir* dir, MenuCache* cache,
MenuCacheFileDir** all_used_files, int n_all_used_files)
{
MenuCacheItem* item;
char *line;
gsize len;
/* nodisplay flag */
if (cache->version >= 2)
{
line = g_data_input_stream_read_line... | DoS | 0 | static void read_dir(GDataInputStream* f, MenuCacheDir* dir, MenuCache* cache,
MenuCacheFileDir** all_used_files, int n_all_used_files)
{
MenuCacheItem* item;
char *line;
gsize len;
/* nodisplay flag */
if (cache->version >= 2)
{
line = g_data_input_stream_read_line... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,120 | static MenuCacheItem* read_item(GDataInputStream* f, MenuCache* cache,
MenuCacheFileDir** all_used_files, int n_all_used_files)
{
MenuCacheItem* item;
char *line;
gsize len;
gint idx;
/* desktop/menu id */
line = g_data_input_stream_read_line(f, &len, cache->canc... | DoS | 0 | static MenuCacheItem* read_item(GDataInputStream* f, MenuCache* cache,
MenuCacheFileDir** all_used_files, int n_all_used_files)
{
MenuCacheItem* item;
char *line;
gsize len;
gint idx;
/* desktop/menu id */
line = g_data_input_stream_read_line(f, &len, cache->canc... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,121 | static gboolean reload_notify(gpointer data)
{
MenuCache* cache = (MenuCache*)data;
GSList* l;
MENU_CACHE_LOCK;
/* we have it referenced and there is no source removal so no check */
for( l = cache->notifiers; l; l = l->next )
{
CacheReloadNotifier* n = (CacheReloadNotifier*)l->data;
... | DoS | 0 | static gboolean reload_notify(gpointer data)
{
MenuCache* cache = (MenuCache*)data;
GSList* l;
MENU_CACHE_LOCK;
/* we have it referenced and there is no source removal so no check */
for( l = cache->notifiers; l; l = l->next )
{
CacheReloadNotifier* n = (CacheReloadNotifier*)l->data;
... | @@ -3,7 +3,7 @@
*
* Copyright 2008 PCMan <pcman.tw@gmail.com>
* Copyright 2009 Jürgen Hötzel <juergen@archlinux.org>
- * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This library is ... | CWE-20 | null | null |
5,122 | static gboolean cache_file_is_updated( const char* cache_file, int* n_used_files, char*** used_files )
{
gboolean ret = FALSE;
struct stat st;
#if 0
time_t cache_mtime;
char** files;
int n, i;
#endif
FILE* f;
f = fopen( cache_file, "r" );
if( f )
{
if( fstat( fileno(f), &st)... | DoS | 0 | static gboolean cache_file_is_updated( const char* cache_file, int* n_used_files, char*** used_files )
{
gboolean ret = FALSE;
struct stat st;
#if 0
time_t cache_mtime;
char** files;
int n, i;
#endif
FILE* f;
f = fopen( cache_file, "r" );
if( f )
{
if( fstat( fileno(f), &st)... | @@ -473,6 +473,9 @@ static void get_socket_name( char* buf, int len )
if(*p)
*p = '\0';
}
+ /* NOTE: this socket name is incompatible with versions > 1.0.2,
+ although this function is never used since 0.7.0 but
+ libmenu-cache always requests exact socket name instea... | CWE-20 | null | null |
5,123 | static gboolean delayed_cache_free(gpointer data)
{
Cache* cache = data;
int i;
if(g_source_is_destroyed(g_main_current_source()))
return FALSE;
g_hash_table_remove( hash, cache->md5 );
/* DEBUG("menu cache freed"); */
for(i = 0; i < cache->n_files; ++i)
{
g_file_monitor_ca... | DoS | 0 | static gboolean delayed_cache_free(gpointer data)
{
Cache* cache = data;
int i;
if(g_source_is_destroyed(g_main_current_source()))
return FALSE;
g_hash_table_remove( hash, cache->md5 );
/* DEBUG("menu cache freed"); */
for(i = 0; i < cache->n_files; ++i)
{
g_file_monitor_ca... | @@ -473,6 +473,9 @@ static void get_socket_name( char* buf, int len )
if(*p)
*p = '\0';
}
+ /* NOTE: this socket name is incompatible with versions > 1.0.2,
+ although this function is never used since 0.7.0 but
+ libmenu-cache always requests exact socket name instea... | CWE-20 | null | null |
5,124 | static gboolean delayed_reload( Cache* cache )
{
if(g_source_is_destroyed(g_main_current_source()))
return FALSE;
if(cache->need_reload)
do_reload(cache);
if (cache->need_reload)
return TRUE;
cache->delayed_reload_handler = 0;
return FALSE;
}
| DoS | 0 | static gboolean delayed_reload( Cache* cache )
{
if(g_source_is_destroyed(g_main_current_source()))
return FALSE;
if(cache->need_reload)
do_reload(cache);
if (cache->need_reload)
return TRUE;
cache->delayed_reload_handler = 0;
return FALSE;
}
| @@ -473,6 +473,9 @@ static void get_socket_name( char* buf, int len )
if(*p)
*p = '\0';
}
+ /* NOTE: this socket name is incompatible with versions > 1.0.2,
+ although this function is never used since 0.7.0 but
+ libmenu-cache always requests exact socket name instea... | CWE-20 | null | null |
5,125 | int EC_GROUP_get_basis_type(const EC_GROUP *group)
{
int i = 0;
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
NID_X9_62_characteristic_two_field)
/* everything else is currently not supported */
return 0;
while (group->poly[i] != 0)
i++;
if (i == 4)
... | DoS Mem. Corr. | 0 | int EC_GROUP_get_basis_type(const EC_GROUP *group)
{
int i = 0;
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) !=
NID_X9_62_characteristic_two_field)
/* everything else is currently not supported */
return 0;
while (group->poly[i] != 0)
i++;
if (i == 4)
... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,126 | int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1,
unsigned int *k2, unsigned int *k3)
{
if (group == NULL)
return 0;
if (EC_GROUP_method_of(group)->group_set_curve !=
ec_GF2m_simple_group_set_curve || !((group->poly[0] != 0)
... | DoS Mem. Corr. | 0 | int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1,
unsigned int *k2, unsigned int *k3)
{
if (group == NULL)
return 0;
if (EC_GROUP_method_of(group)->group_set_curve !=
ec_GF2m_simple_group_set_curve || !((group->poly[0] != 0)
... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,127 | static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
{
int ok = 0, nid;
BIGNUM *tmp = NULL;
if (group == NULL || field == NULL)
return 0;
/* clear the old values (if necessary) */
if (field->fieldType != NULL)
ASN1_OBJECT_free(field->fieldType);
if (fie... | DoS Mem. Corr. | 0 | static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field)
{
int ok = 0, nid;
BIGNUM *tmp = NULL;
if (group == NULL || field == NULL)
return 0;
/* clear the old values (if necessary) */
if (field->fieldType != NULL)
ASN1_OBJECT_free(field->fieldType);
if (fie... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,128 | static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
{
int ok = 0, tmp;
EC_GROUP *ret = NULL;
BIGNUM *p = NULL, *a = NULL, *b = NULL;
EC_POINT *point = NULL;
long field_bits;
if (!params->fieldID || !params->fieldID->fieldType ||
!params->fieldID->p.ptr) {
ECerr... | DoS Mem. Corr. | 0 | static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
{
int ok = 0, tmp;
EC_GROUP *ret = NULL;
BIGNUM *p = NULL, *a = NULL, *b = NULL;
EC_POINT *point = NULL;
long field_bits;
if (!params->fieldID || !params->fieldID->fieldType ||
!params->fieldID->p.ptr) {
ECerr... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,129 | EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *params)
{
EC_GROUP *ret = NULL;
int tmp = 0;
if (params == NULL) {
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP, EC_R_MISSING_PARAMETERS);
return NULL;
}
if (params->type == 0) { /* the curve is given by an OID */
tmp =... | DoS Mem. Corr. | 0 | EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *params)
{
EC_GROUP *ret = NULL;
int tmp = 0;
if (params == NULL) {
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP, EC_R_MISSING_PARAMETERS);
return NULL;
}
if (params->type == 0) { /* the curve is given by an OID */
tmp =... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,130 | int i2d_ECPKParameters(const EC_GROUP *a, unsigned char **out)
{
int ret = 0;
ECPKPARAMETERS *tmp = ec_asn1_group2pkparameters(a, NULL);
if (tmp == NULL) {
ECerr(EC_F_I2D_ECPKPARAMETERS, EC_R_GROUP2PKPARAMETERS_FAILURE);
return 0;
}
if ((ret = i2d_ECPKPARAMETERS(tmp, out)) == 0) {
... | DoS Mem. Corr. | 0 | int i2d_ECPKParameters(const EC_GROUP *a, unsigned char **out)
{
int ret = 0;
ECPKPARAMETERS *tmp = ec_asn1_group2pkparameters(a, NULL);
if (tmp == NULL) {
ECerr(EC_F_I2D_ECPKPARAMETERS, EC_R_GROUP2PKPARAMETERS_FAILURE);
return 0;
}
if ((ret = i2d_ECPKPARAMETERS(tmp, out)) == 0) {
... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,131 | int i2d_ECParameters(EC_KEY *a, unsigned char **out)
{
if (a == NULL) {
ECerr(EC_F_I2D_ECPARAMETERS, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
return i2d_ECPKParameters(a->group, out);
}
| DoS Mem. Corr. | 0 | int i2d_ECParameters(EC_KEY *a, unsigned char **out)
{
if (a == NULL) {
ECerr(EC_F_I2D_ECPARAMETERS, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
return i2d_ECPKParameters(a->group, out);
}
| @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,132 | int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out)
{
int ret = 0, ok = 0;
unsigned char *buffer = NULL;
size_t buf_len = 0, tmp_len;
EC_PRIVATEKEY *priv_key = NULL;
if (a == NULL || a->group == NULL || a->priv_key == NULL) {
ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
... | DoS Mem. Corr. | 0 | int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out)
{
int ret = 0, ok = 0;
unsigned char *buffer = NULL;
size_t buf_len = 0, tmp_len;
EC_PRIVATEKEY *priv_key = NULL;
if (a == NULL || a->group == NULL || a->priv_key == NULL) {
ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,133 | int i2o_ECPublicKey(EC_KEY *a, unsigned char **out)
{
size_t buf_len = 0;
int new_buffer = 0;
if (a == NULL) {
ECerr(EC_F_I2O_ECPUBLICKEY, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
buf_len = EC_POINT_point2oct(a->group, a->pub_key,
a->conv_form, NUL... | DoS Mem. Corr. | 0 | int i2o_ECPublicKey(EC_KEY *a, unsigned char **out)
{
size_t buf_len = 0;
int new_buffer = 0;
if (a == NULL) {
ECerr(EC_F_I2O_ECPUBLICKEY, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
buf_len = EC_POINT_point2oct(a->group, a->pub_key,
a->conv_form, NUL... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,134 | EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len)
{
EC_KEY *ret = NULL;
if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
/*
* sorry, but a EC_GROUP-structur is necessary to set the public key
*/
ECerr(EC_F_O2I_ECPUBLICKEY, ERR_R_PASSED_NULL_PARAMET... | DoS Mem. Corr. | 0 | EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len)
{
EC_KEY *ret = NULL;
if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
/*
* sorry, but a EC_GROUP-structur is necessary to set the public key
*/
ECerr(EC_F_O2I_ECPUBLICKEY, ERR_R_PASSED_NULL_PARAMET... | @@ -1014,8 +1014,6 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (a)
- *a = ret;
} else
ret = *a;
@@ -1067,10 +1065,12 @@ EC_KEY *d2i_ECPrivateKey(EC_KE... | null | null | null |
5,135 | static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)
{
const unsigned char *p;
int plen;
if (alg == NULL)
return NULL;
if (OBJ_obj2nid(alg->algorithm) != NID_mgf1)
return NULL;
if (alg->parameter->type != V_ASN1_SEQUENCE)
return NULL;
p = alg->parameter->value.sequence->d... | DoS | 0 | static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)
{
const unsigned char *p;
int plen;
if (alg == NULL)
return NULL;
if (OBJ_obj2nid(alg->algorithm) != NID_mgf1)
return NULL;
if (alg->parameter->type != V_ASN1_SEQUENCE)
return NULL;
p = alg->parameter->value.sequence->d... | @@ -698,9 +698,10 @@ static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
RSAerr(RSA_F_RSA_ITEM_VERIFY, RSA_R_UNSUPPORTED_SIGNATURE_TYPE);
return -1;
}
- if (rsa_pss_to_ctx(ctx, NULL, sigalg, pkey))
+ if (rsa_pss_to_ctx(ctx, NULL, sigalg, pkey) > 0) {
/* Carr... | null | null | null |
5,136 | void dtls1_clear(SSL *s)
{
pqueue unprocessed_rcds;
pqueue processed_rcds;
pqueue buffered_messages;
pqueue sent_messages;
pqueue buffered_app_data;
unsigned int mtu;
unsigned int link_mtu;
if (s->d1) {
unprocessed_rcds = s->d1->unprocessed_rcds.q;
processed_rcds = s->d1... | DoS | 0 | void dtls1_clear(SSL *s)
{
pqueue unprocessed_rcds;
pqueue processed_rcds;
pqueue buffered_messages;
pqueue sent_messages;
pqueue buffered_app_data;
unsigned int mtu;
unsigned int link_mtu;
if (s->d1) {
unprocessed_rcds = s->d1->unprocessed_rcds.q;
processed_rcds = s->d1... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,137 | static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *)item->data;
if (rdata->rbuf.buf) {
OPENSSL_free(rdata->rbuf.buf);
... | DoS | 0 | static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *)item->data;
if (rdata->rbuf.buf) {
OPENSSL_free(rdata->rbuf.buf);
... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,138 | long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg)
{
int ret = 0;
switch (cmd) {
case DTLS_CTRL_GET_TIMEOUT:
if (dtls1_get_timeout(s, (struct timeval *)parg) != NULL) {
ret = 1;
}
break;
case DTLS_CTRL_HANDLE_TIMEOUT:
ret = dtls1_handle_timeout(s);
... | DoS | 0 | long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg)
{
int ret = 0;
switch (cmd) {
case DTLS_CTRL_GET_TIMEOUT:
if (dtls1_get_timeout(s, (struct timeval *)parg) != NULL) {
ret = 1;
}
break;
case DTLS_CTRL_HANDLE_TIMEOUT:
ret = dtls1_handle_timeout(s);
... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,139 | long dtls1_default_timeout(void)
{
/*
* 2 hours, the 24 hours mentioned in the DTLSv1 spec is way too long for
* http, the cache would over fill
*/
return (60 * 60 * 2);
}
| DoS | 0 | long dtls1_default_timeout(void)
{
/*
* 2 hours, the 24 hours mentioned in the DTLSv1 spec is way too long for
* http, the cache would over fill
*/
return (60 * 60 * 2);
}
| @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,140 | void dtls1_double_timeout(SSL *s)
{
s->d1->timeout_duration *= 2;
if (s->d1->timeout_duration > 60)
s->d1->timeout_duration = 60;
dtls1_start_timer(s);
}
| DoS | 0 | void dtls1_double_timeout(SSL *s)
{
s->d1->timeout_duration *= 2;
if (s->d1->timeout_duration > 60)
s->d1->timeout_duration = 60;
dtls1_start_timer(s);
}
| @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,141 | void dtls1_free(SSL *s)
{
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(s->d1->unprocessed_rcds.q);
pqueue_free(s->d1->processed_rcds.q);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
pqueue_free(s->d1->buffered_app_data.q);
OPENSSL_free(s->d1);
s->d... | DoS | 0 | void dtls1_free(SSL *s)
{
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(s->d1->unprocessed_rcds.q);
pqueue_free(s->d1->processed_rcds.q);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
pqueue_free(s->d1->buffered_app_data.q);
OPENSSL_free(s->d1);
s->d... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,142 | const SSL_CIPHER *dtls1_get_cipher(unsigned int u)
{
const SSL_CIPHER *ciph = ssl3_get_cipher(u);
if (ciph != NULL) {
if (ciph->algorithm_enc == SSL_RC4)
return NULL;
}
return ciph;
}
| DoS | 0 | const SSL_CIPHER *dtls1_get_cipher(unsigned int u)
{
const SSL_CIPHER *ciph = ssl3_get_cipher(u);
if (ciph != NULL) {
if (ciph->algorithm_enc == SSL_RC4)
return NULL;
}
return ciph;
}
| @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,143 | struct timeval *dtls1_get_timeout(SSL *s, struct timeval *timeleft)
{
struct timeval timenow;
/* If no timeout is set, just return NULL */
if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
return NULL;
}
/* Get current time */
get_current_time(&timenow);
/... | DoS | 0 | struct timeval *dtls1_get_timeout(SSL *s, struct timeval *timeleft)
{
struct timeval timenow;
/* If no timeout is set, just return NULL */
if (s->d1->next_timeout.tv_sec == 0 && s->d1->next_timeout.tv_usec == 0) {
return NULL;
}
/* Get current time */
get_current_time(&timenow);
/... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,144 | int dtls1_handle_timeout(SSL *s)
{
/* if no timer is expired, don't do anything */
if (!dtls1_is_timer_expired(s)) {
return 0;
}
dtls1_double_timeout(s);
if (dtls1_check_timeout_num(s) < 0)
return -1;
s->d1->timeout.read_timeouts++;
if (s->d1->timeout.read_timeouts > DTLS1... | DoS | 0 | int dtls1_handle_timeout(SSL *s)
{
/* if no timer is expired, don't do anything */
if (!dtls1_is_timer_expired(s)) {
return 0;
}
dtls1_double_timeout(s);
if (dtls1_check_timeout_num(s) < 0)
return -1;
s->d1->timeout.read_timeouts++;
if (s->d1->timeout.read_timeouts > DTLS1... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,145 | static int dtls1_handshake_write(SSL *s)
{
return dtls1_do_write(s, SSL3_RT_HANDSHAKE);
}
| DoS | 0 | static int dtls1_handshake_write(SSL *s)
{
return dtls1_do_write(s, SSL3_RT_HANDSHAKE);
}
| @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,146 | int dtls1_is_timer_expired(SSL *s)
{
struct timeval timeleft;
/* Get time left until timeout, return false if no timer running */
if (dtls1_get_timeout(s, &timeleft) == NULL) {
return 0;
}
/* Return false if timer is not expired yet */
if (timeleft.tv_sec > 0 || timeleft.tv_usec > 0) {... | DoS | 0 | int dtls1_is_timer_expired(SSL *s)
{
struct timeval timeleft;
/* Get time left until timeout, return false if no timer running */
if (dtls1_get_timeout(s, &timeleft) == NULL) {
return 0;
}
/* Return false if timer is not expired yet */
if (timeleft.tv_sec > 0 || timeleft.tv_usec > 0) {... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,147 | int dtls1_new(SSL *s)
{
DTLS1_STATE *d1;
if (!ssl3_new(s))
return (0);
if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL)
return (0);
memset(d1, 0, sizeof *d1);
/* d1->handshake_epoch=0; */
d1->unprocessed_rcds.q = pqueue_new();
d1->processed_rcds.q = pqueue_new();
d1->buf... | DoS | 0 | int dtls1_new(SSL *s)
{
DTLS1_STATE *d1;
if (!ssl3_new(s))
return (0);
if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL)
return (0);
memset(d1, 0, sizeof *d1);
/* d1->handshake_epoch=0; */
d1->unprocessed_rcds.q = pqueue_new();
d1->processed_rcds.q = pqueue_new();
d1->buf... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,148 | static void dtls1_set_handshake_header(SSL *s, int htype, unsigned long len)
{
unsigned char *p = (unsigned char *)s->init_buf->data;
dtls1_set_message_header(s, p, htype, len, 0, len);
s->init_num = (int)len + DTLS1_HM_HEADER_LENGTH;
s->init_off = 0;
/* Buffer the message to handle re-xmits */
... | DoS | 0 | static void dtls1_set_handshake_header(SSL *s, int htype, unsigned long len)
{
unsigned char *p = (unsigned char *)s->init_buf->data;
dtls1_set_message_header(s, p, htype, len, 0, len);
s->init_num = (int)len + DTLS1_HM_HEADER_LENGTH;
s->init_off = 0;
/* Buffer the message to handle re-xmits */
... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,149 | void dtls1_start_timer(SSL *s)
{
#ifndef OPENSSL_NO_SCTP
/* Disable timer for SCTP */
if (BIO_dgram_is_sctp(SSL_get_wbio(s))) {
memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
return;
}
#endif
/* If timer is not set, initialize duration with 1 second */
if (s->d1->next_ti... | DoS | 0 | void dtls1_start_timer(SSL *s)
{
#ifndef OPENSSL_NO_SCTP
/* Disable timer for SCTP */
if (BIO_dgram_is_sctp(SSL_get_wbio(s))) {
memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
return;
}
#endif
/* If timer is not set, initialize duration with 1 second */
if (s->d1->next_ti... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,150 | void dtls1_stop_timer(SSL *s)
{
/* Reset everything */
memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st));
memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
s->d1->timeout_duration = 1;
BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
&(s->d1->next_timeo... | DoS | 0 | void dtls1_stop_timer(SSL *s)
{
/* Reset everything */
memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st));
memset(&(s->d1->next_timeout), 0, sizeof(struct timeval));
s->d1->timeout_duration = 1;
BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0,
&(s->d1->next_timeo... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,151 | static void get_current_time(struct timeval *t)
{
#if defined(_WIN32)
SYSTEMTIME st;
union {
unsigned __int64 ul;
FILETIME ft;
} now;
GetSystemTime(&st);
SystemTimeToFileTime(&st, &now.ft);
# ifdef __MINGW32__
now.ul -= 116444736000000000ULL;
# else
now.ul -= 11644473600000... | DoS | 0 | static void get_current_time(struct timeval *t)
{
#if defined(_WIN32)
SYSTEMTIME st;
union {
unsigned __int64 ul;
FILETIME ft;
} now;
GetSystemTime(&st);
SystemTimeToFileTime(&st, &now.ft);
# ifdef __MINGW32__
now.ul -= 116444736000000000ULL;
# else
now.ul -= 11644473600000... | @@ -543,6 +543,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1; | null | null | null |
5,152 | _bdf_add_comment( bdf_font_t* font,
char* comment,
unsigned long len )
{
char* cp;
FT_Memory memory = font->memory;
FT_Error error = BDF_Err_Ok;
if ( FT_RENEW_ARRAY( font->comments,
font->comments_len,
... | DoS Overflow | 0 | _bdf_add_comment( bdf_font_t* font,
char* comment,
unsigned long len )
{
char* cp;
FT_Memory memory = font->memory;
FT_Error error = BDF_Err_Ok;
if ( FT_RENEW_ARRAY( font->comments,
font->comments_len,
... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,153 | _bdf_add_property( bdf_font_t* font,
char* name,
char* value,
unsigned long lineno )
{
size_t propid;
hashnode hn;
bdf_property_t *prop, *fp;
FT_Memory memory = font->memory;
FT_Error ... | DoS Overflow | 0 | _bdf_add_property( bdf_font_t* font,
char* name,
char* value,
unsigned long lineno )
{
size_t propid;
hashnode hn;
bdf_property_t *prop, *fp;
FT_Memory memory = font->memory;
FT_Error ... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,154 | _bdf_atol( char* s,
char** end,
int base )
{
long v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = ... | DoS Overflow | 0 | _bdf_atol( char* s,
char** end,
int base )
{
long v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = ... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,155 | _bdf_atos( char* s,
char** end,
int base )
{
short v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = ... | DoS Overflow | 0 | _bdf_atos( char* s,
char** end,
int base )
{
short v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = ... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,156 | _bdf_atoul( char* s,
char** end,
int base )
{
unsigned long v;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = od... | DoS Overflow | 0 | _bdf_atoul( char* s,
char** end,
int base )
{
unsigned long v;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = od... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,157 | _bdf_is_atom( char* line,
unsigned long linelen,
char** name,
char** value,
bdf_font_t* font )
{
int hold;
char *sp, *ep;
bdf_property_t* p;
*name = sp = ep = line;
while ( *... | DoS Overflow | 0 | _bdf_is_atom( char* line,
unsigned long linelen,
char** name,
char** value,
bdf_font_t* font )
{
int hold;
char *sp, *ep;
bdf_property_t* p;
*name = sp = ep = line;
while ( *... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,158 | _bdf_list_done( _bdf_list_t* list )
{
FT_Memory memory = list->memory;
if ( memory )
{
FT_FREE( list->field );
FT_ZERO( list );
}
}
| DoS Overflow | 0 | _bdf_list_done( _bdf_list_t* list )
{
FT_Memory memory = list->memory;
if ( memory )
{
FT_FREE( list->field );
FT_ZERO( list );
}
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,159 | _bdf_list_init( _bdf_list_t* list,
FT_Memory memory )
{
FT_ZERO( list );
list->memory = memory;
}
| DoS Overflow | 0 | _bdf_list_init( _bdf_list_t* list,
FT_Memory memory )
{
FT_ZERO( list );
list->memory = memory;
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,160 | _bdf_list_split( _bdf_list_t* list,
char* separators,
char* line,
unsigned long linelen )
{
int mult, final_empty;
char *sp, *ep, *end;
char seps[32];
FT_Error error = BDF_Err_Ok;
/* Initialize the l... | DoS Overflow | 0 | _bdf_list_split( _bdf_list_t* list,
char* separators,
char* line,
unsigned long linelen )
{
int mult, final_empty;
char *sp, *ep, *end;
char seps[32];
FT_Error error = BDF_Err_Ok;
/* Initialize the l... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,161 | _bdf_parse_properties( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
unsigned long vlen;
_bdf_line_func_t* next;
_bdf_p... | DoS Overflow | 0 | _bdf_parse_properties( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
unsigned long vlen;
_bdf_line_func_t* next;
_bdf_p... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,162 | _bdf_parse_start( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
unsigned long slen;
_bdf_line_func_t* next;
_bdf_parse_t* p;
bdf_f... | DoS Overflow | 0 | _bdf_parse_start( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
unsigned long slen;
_bdf_line_func_t* next;
_bdf_parse_t* p;
bdf_f... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,163 | _bdf_set_default_spacing( bdf_font_t* font,
bdf_options_t* opts,
unsigned long lineno )
{
size_t len;
char name[256];
_bdf_list_t list;
FT_Memory memory;
FT_Error error = BDF_Err_Ok;
if ( font == 0 || font... | DoS Overflow | 0 | _bdf_set_default_spacing( bdf_font_t* font,
bdf_options_t* opts,
unsigned long lineno )
{
size_t len;
char name[256];
_bdf_list_t list;
FT_Memory memory;
FT_Error error = BDF_Err_Ok;
if ( font == 0 || font... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,164 | bdf_create_property( char* name,
int format,
bdf_font_t* font )
{
size_t n;
bdf_property_t* p;
FT_Memory memory = font->memory;
FT_Error error = BDF_Err_Ok;
/* First check whether the property has *... | DoS Overflow | 0 | bdf_create_property( char* name,
int format,
bdf_font_t* font )
{
size_t n;
bdf_property_t* p;
FT_Memory memory = font->memory;
FT_Error error = BDF_Err_Ok;
/* First check whether the property has *... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,165 | bdf_free_font( bdf_font_t* font )
{
bdf_property_t* prop;
unsigned long i;
bdf_glyph_t* glyphs;
FT_Memory memory;
if ( font == 0 )
return;
memory = font->memory;
FT_FREE( font->name );
/* Free up the internal hash table of property names. */
if ( font->... | DoS Overflow | 0 | bdf_free_font( bdf_font_t* font )
{
bdf_property_t* prop;
unsigned long i;
bdf_glyph_t* glyphs;
FT_Memory memory;
if ( font == 0 )
return;
memory = font->memory;
FT_FREE( font->name );
/* Free up the internal hash table of property names. */
if ( font->... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,166 | bdf_get_font_property( bdf_font_t* font,
const char* name )
{
hashnode hn;
if ( font == 0 || font->props_size == 0 || name == 0 || *name == 0 )
return 0;
hn = hash_lookup( name, (hashtable *)font->internal );
return hn ? ( font->props + hn->data ) : 0;
}
| DoS Overflow | 0 | bdf_get_font_property( bdf_font_t* font,
const char* name )
{
hashnode hn;
if ( font == 0 || font->props_size == 0 || name == 0 || *name == 0 )
return 0;
hn = hash_lookup( name, (hashtable *)font->internal );
return hn ? ( font->props + hn->data ) : 0;
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,167 | bdf_get_property( char* name,
bdf_font_t* font )
{
hashnode hn;
size_t propid;
if ( name == 0 || *name == 0 )
return 0;
if ( ( hn = hash_lookup( name, &(font->proptbl) ) ) == 0 )
return 0;
propid = hn->data;
if ( propid >= _num_bdf_properties )... | DoS Overflow | 0 | bdf_get_property( char* name,
bdf_font_t* font )
{
hashnode hn;
size_t propid;
if ( name == 0 || *name == 0 )
return 0;
if ( ( hn = hash_lookup( name, &(font->proptbl) ) ) == 0 )
return 0;
propid = hn->data;
if ( propid >= _num_bdf_properties )... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,168 | bdf_load_font( FT_Stream stream,
FT_Memory extmemory,
bdf_options_t* opts,
bdf_font_t* *font )
{
unsigned long lineno = 0; /* make compiler happy */
_bdf_parse_t *p = NULL;
FT_Memory memory = extmemory;
FT_Error er... | DoS Overflow | 0 | bdf_load_font( FT_Stream stream,
FT_Memory extmemory,
bdf_options_t* opts,
bdf_font_t* *font )
{
unsigned long lineno = 0; /* make compiler happy */
_bdf_parse_t *p = NULL;
FT_Memory memory = extmemory;
FT_Error er... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,169 | hash_bucket( const char* key,
hashtable* ht )
{
const char* kp = key;
unsigned long res = 0;
hashnode* bp = ht->table, *ndp;
/* Mocklisp hash function. */
while ( *kp )
res = ( res << 5 ) - res + *kp++;
ndp = bp + ( res % ht->size );
while ( *ndp )
... | DoS Overflow | 0 | hash_bucket( const char* key,
hashtable* ht )
{
const char* kp = key;
unsigned long res = 0;
hashnode* bp = ht->table, *ndp;
/* Mocklisp hash function. */
while ( *kp )
res = ( res << 5 ) - res + *kp++;
ndp = bp + ( res % ht->size );
while ( *ndp )
... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,170 | hash_free( hashtable* ht,
FT_Memory memory )
{
if ( ht != 0 )
{
int i, sz = ht->size;
hashnode* bp = ht->table;
for ( i = 0; i < sz; i++, bp++ )
FT_FREE( *bp );
FT_FREE( ht->table );
}
}
| DoS Overflow | 0 | hash_free( hashtable* ht,
FT_Memory memory )
{
if ( ht != 0 )
{
int i, sz = ht->size;
hashnode* bp = ht->table;
for ( i = 0; i < sz; i++, bp++ )
FT_FREE( *bp );
FT_FREE( ht->table );
}
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,171 | hash_init( hashtable* ht,
FT_Memory memory )
{
int sz = INITIAL_HT_SIZE;
FT_Error error = BDF_Err_Ok;
ht->size = sz;
ht->limit = sz / 3;
ht->used = 0;
if ( FT_NEW_ARRAY( ht->table, sz ) )
goto Exit;
Exit:
return error;
}
| DoS Overflow | 0 | hash_init( hashtable* ht,
FT_Memory memory )
{
int sz = INITIAL_HT_SIZE;
FT_Error error = BDF_Err_Ok;
ht->size = sz;
ht->limit = sz / 3;
ht->used = 0;
if ( FT_NEW_ARRAY( ht->table, sz ) )
goto Exit;
Exit:
return error;
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,172 | hash_insert( char* key,
size_t data,
hashtable* ht,
FT_Memory memory )
{
hashnode nn, *bp = hash_bucket( key, ht );
FT_Error error = BDF_Err_Ok;
nn = *bp;
if ( !nn )
{
if ( FT_NEW( nn ) )
goto Exit;
*bp = nn;
... | DoS Overflow | 0 | hash_insert( char* key,
size_t data,
hashtable* ht,
FT_Memory memory )
{
hashnode nn, *bp = hash_bucket( key, ht );
FT_Error error = BDF_Err_Ok;
nn = *bp;
if ( !nn )
{
if ( FT_NEW( nn ) )
goto Exit;
*bp = nn;
... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,173 | hash_lookup( const char* key,
hashtable* ht )
{
hashnode *np = hash_bucket( key, ht );
return *np;
}
| DoS Overflow | 0 | hash_lookup( const char* key,
hashtable* ht )
{
hashnode *np = hash_bucket( key, ht );
return *np;
}
| @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,174 | hash_rehash( hashtable* ht,
FT_Memory memory )
{
hashnode* obp = ht->table, *bp, *nbp;
int i, sz = ht->size;
FT_Error error = BDF_Err_Ok;
ht->size <<= 1;
ht->limit = ht->size / 3;
if ( FT_NEW_ARRAY( ht->table, ht->size ) )
goto Exit;
for ( i = 0, bp... | DoS Overflow | 0 | hash_rehash( hashtable* ht,
FT_Memory memory )
{
hashnode* obp = ht->table, *bp, *nbp;
int i, sz = ht->size;
FT_Error error = BDF_Err_Ok;
ht->size <<= 1;
ht->limit = ht->size / 3;
if ( FT_NEW_ARRAY( ht->table, ht->size ) )
goto Exit;
for ( i = 0, bp... | @@ -1624,6 +1624,9 @@
if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+ if ( p->glyph_enc < -1 )
+ p->glyph_enc = -1;
+
FT_TRACE4(( DBGMSG2, p->glyph_enc ));
/* Check that the encoding is in the Unicode range because */ | CWE-119 | null | null |
5,175 | dfaerror (char const *mesg)
{
error (EXIT_TROUBLE, 0, "%s", mesg);
/* notreached */
/* Tell static analyzers that this function does not return. */
abort ();
}
| Exec Code Overflow | 0 | dfaerror (char const *mesg)
{
error (EXIT_TROUBLE, 0, "%s", mesg);
/* notreached */
/* Tell static analyzers that this function does not return. */
abort ();
}
| @@ -19,6 +19,7 @@
/* Written August 1992 by Mike Haertel. */
#include <config.h>
+#include "intprops.h"
#include "search.h"
#include "dfa.h"
@@ -71,7 +72,7 @@ dfawarn (char const *mesg)
/* Number of compiled fixed strings known to exactly match the regexp.
If kwsexec returns < kwset_exact_matches, then we ... | CWE-189 | null | null |
5,176 | dfawarn (char const *mesg)
{
static enum { DW_NONE = 0, DW_POSIX, DW_GNU } mode;
if (mode == DW_NONE)
mode = (getenv ("POSIXLY_CORRECT") ? DW_POSIX : DW_GNU);
if (mode == DW_GNU)
dfaerror (mesg);
}
| Exec Code Overflow | 0 | dfawarn (char const *mesg)
{
static enum { DW_NONE = 0, DW_POSIX, DW_GNU } mode;
if (mode == DW_NONE)
mode = (getenv ("POSIXLY_CORRECT") ? DW_POSIX : DW_GNU);
if (mode == DW_GNU)
dfaerror (mesg);
}
| @@ -19,6 +19,7 @@
/* Written August 1992 by Mike Haertel. */
#include <config.h>
+#include "intprops.h"
#include "search.h"
#include "dfa.h"
@@ -71,7 +72,7 @@ dfawarn (char const *mesg)
/* Number of compiled fixed strings known to exactly match the regexp.
If kwsexec returns < kwset_exact_matches, then we ... | CWE-189 | null | null |
5,177 | bmexec (kwset_t kws, char const *text, size_t size)
{
struct kwset const *kwset;
unsigned char const *d1;
char const *ep, *sp, *tp;
int d, gc, i, len, md2;
kwset = (struct kwset const *) kws;
len = kwset->mind;
if (len == 0)
return 0;
if (len > size)
return -1;
if (len == 1)
{
tp =... | Exec Code Overflow | 0 | bmexec (kwset_t kws, char const *text, size_t size)
{
struct kwset const *kwset;
unsigned char const *d1;
char const *ep, *sp, *tp;
int d, gc, i, len, md2;
kwset = (struct kwset const *) kws;
len = kwset->mind;
if (len == 0)
return 0;
if (len > size)
return -1;
if (len == 1)
{
tp =... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,178 | cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
{
struct kwset const *kwset;
struct trie * const *next;
struct trie const *trie;
struct trie const *accept;
char const *beg, *lim, *mch, *lmch;
unsigned char c;
unsigned char const *delta;
int d;
char const *end, *qlim;
st... | Exec Code Overflow | 0 | cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
{
struct kwset const *kwset;
struct trie * const *next;
struct trie const *trie;
struct trie const *accept;
char const *beg, *lim, *mch, *lmch;
unsigned char c;
unsigned char const *delta;
int d;
char const *end, *qlim;
st... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,179 | kwsalloc (char const *trans)
{
struct kwset *kwset;
kwset = (struct kwset *) malloc(sizeof (struct kwset));
if (!kwset)
return NULL;
obstack_init(&kwset->obstack);
kwset->words = 0;
kwset->trie
= (struct trie *) obstack_alloc(&kwset->obstack, sizeof (struct trie));
if (!kwset->trie)
{
... | Exec Code Overflow | 0 | kwsalloc (char const *trans)
{
struct kwset *kwset;
kwset = (struct kwset *) malloc(sizeof (struct kwset));
if (!kwset)
return NULL;
obstack_init(&kwset->obstack);
kwset->words = 0;
kwset->trie
= (struct trie *) obstack_alloc(&kwset->obstack, sizeof (struct trie));
if (!kwset->trie)
{
... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,180 | kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
{
struct kwset const *kwset = (struct kwset *) kws;
if (kwset->words == 1 && kwset->trans == NULL)
{
size_t ret = bmexec (kws, text, size);
if (ret != (size_t) -1)
{
kwsmatch->index = 0;
kwsma... | Exec Code Overflow | 0 | kwsexec (kwset_t kws, char const *text, size_t size, struct kwsmatch *kwsmatch)
{
struct kwset const *kwset = (struct kwset *) kws;
if (kwset->words == 1 && kwset->trans == NULL)
{
size_t ret = bmexec (kws, text, size);
if (ret != (size_t) -1)
{
kwsmatch->index = 0;
kwsma... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,181 | kwsfree (kwset_t kws)
{
struct kwset *kwset;
kwset = (struct kwset *) kws;
obstack_free(&kwset->obstack, NULL);
free(kws);
}
| Exec Code Overflow | 0 | kwsfree (kwset_t kws)
{
struct kwset *kwset;
kwset = (struct kwset *) kws;
obstack_free(&kwset->obstack, NULL);
free(kws);
}
| @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,182 | kwsincr (kwset_t kws, char const *text, size_t len)
{
struct kwset *kwset;
struct trie *trie;
unsigned char label;
struct tree *link;
int depth;
struct tree *links[DEPTH_SIZE];
enum { L, R } dirs[DEPTH_SIZE];
struct tree *t, *r, *l, *rl, *lr;
kwset = (struct kwset *) kws;
trie = kwset->trie;
text... | Exec Code Overflow | 0 | kwsincr (kwset_t kws, char const *text, size_t len)
{
struct kwset *kwset;
struct trie *trie;
unsigned char label;
struct tree *link;
int depth;
struct tree *links[DEPTH_SIZE];
enum { L, R } dirs[DEPTH_SIZE];
struct tree *t, *r, *l, *rl, *lr;
kwset = (struct kwset *) kws;
trie = kwset->trie;
text... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,183 | kwsprep (kwset_t kws)
{
struct kwset *kwset;
int i;
struct trie *curr;
char const *trans;
unsigned char delta[NCHAR];
kwset = (struct kwset *) kws;
/* Initial values for the delta table; will be changed later. The
delta entry for a given character is the smallest depth of any
node at which an... | Exec Code Overflow | 0 | kwsprep (kwset_t kws)
{
struct kwset *kwset;
int i;
struct trie *curr;
char const *trans;
unsigned char delta[NCHAR];
kwset = (struct kwset *) kws;
/* Initial values for the delta table; will be changed later. The
delta entry for a given character is the smallest depth of any
node at which an... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,184 | treefails (struct tree const *tree, struct trie const *fail,
struct trie *recourse)
{
struct tree *link;
if (!tree)
return;
treefails(tree->llink, fail, recourse);
treefails(tree->rlink, fail, recourse);
/* Find, in the chain of fails going back to the root, the first
node that has a de... | Exec Code Overflow | 0 | treefails (struct tree const *tree, struct trie const *fail,
struct trie *recourse)
{
struct tree *link;
if (!tree)
return;
treefails(tree->llink, fail, recourse);
treefails(tree->rlink, fail, recourse);
/* Find, in the chain of fails going back to the root, the first
node that has a de... | @@ -62,7 +62,7 @@ struct tree
/* Node of a trie representing a set of reversed keywords. */
struct trie
{
- unsigned int accepting; /* Word index of accepted word, or zero. */
+ size_t accepting; /* Word index of accepted word, or zero. */
struct tree *links; /* Tree of edges leaving this node. */
struct t... | CWE-189 | null | null |
5,185 | clean_up_stdout (void)
{
if (! write_error_seen)
close_stdout ();
close_stdout ();
}
| Exec Code Overflow | 0 | clean_up_stdout (void)
{
if (! write_error_seen)
close_stdout ();
close_stdout ();
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,186 | color_cap_mt_fct (void)
{
/* Our caller just set selected_match_color. */
context_match_color = selected_match_color;
}
| Exec Code Overflow | 0 | color_cap_mt_fct (void)
{
/* Our caller just set selected_match_color. */
context_match_color = selected_match_color;
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,187 | color_cap_rv_fct (void)
{
/* By this point, it was 1 (or already -1). */
color_option = -1; /* That's still != 0. */
}
| Exec Code Overflow | 0 | color_cap_rv_fct (void)
{
/* By this point, it was 1 (or already -1). */
color_option = -1; /* That's still != 0. */
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,188 | pr_sgr_end (char const *s)
{
if (*s)
print_end_colorize (sgr_end);
}
| Exec Code Overflow | 0 | pr_sgr_end (char const *s)
{
if (*s)
print_end_colorize (sgr_end);
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,189 | pr_sgr_end_if (char const *s)
{
if (color_option)
pr_sgr_end (s);
}
| Exec Code Overflow | 0 | pr_sgr_end_if (char const *s)
{
if (color_option)
pr_sgr_end (s);
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,190 | pr_sgr_start (char const *s)
{
if (*s)
print_start_colorize (sgr_start, s);
}
| Exec Code Overflow | 0 | pr_sgr_start (char const *s)
{
if (*s)
print_start_colorize (sgr_start, s);
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,191 | suppressible_error (char const *mesg, int errnum)
{
if (! suppress_errors)
error (0, errnum, "%s", mesg);
errseen = 1;
}
| Exec Code Overflow | 0 | suppressible_error (char const *mesg, int errnum)
{
if (! suppress_errors)
error (0, errnum, "%s", mesg);
errseen = 1;
}
| @@ -25,6 +25,7 @@
#include <wchar.h>
#include <wctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include "system.h"
@@ -425,17 +426,21 @@ clean_up_stdout (void)
close_stdout ();
}
-/* Convert STR to a positive integer, storing the result in *OUT.
+/* Convert STR to a nonnegative int... | CWE-189 | null | null |
5,192 | Smb4KGlobal::Smb4KEvent::Smb4KEvent( QEvent::Type type ): QEvent( type )
{
}
| +Priv | 0 | Smb4KGlobal::Smb4KEvent::Smb4KEvent( QEvent::Type type ): QEvent( type )
{
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,193 | void Smb4KGlobal::abortCore()
{
Smb4KScanner::self()->abortAll();
Smb4KMounter::self()->abortAll();
Smb4KPrint::self()->abortAll();
Smb4KSynchronizer::self()->abortAll();
Smb4KPreviewer::self()->abortAll();
Smb4KSearch::self()->abortAll();
}
| +Priv | 0 | void Smb4KGlobal::abortCore()
{
Smb4KScanner::self()->abortAll();
Smb4KMounter::self()->abortAll();
Smb4KPrint::self()->abortAll();
Smb4KSynchronizer::self()->abortAll();
Smb4KPreviewer::self()->abortAll();
Smb4KSearch::self()->abortAll();
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,194 | bool Smb4KGlobal::addHost( Smb4KHost *host )
{
Q_ASSERT( host );
bool added = false;
mutex.lock();
if ( !findHost( host->hostName(), host->workgroupName() ) )
{
p->hostsList.append( host );
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| +Priv | 0 | bool Smb4KGlobal::addHost( Smb4KHost *host )
{
Q_ASSERT( host );
bool added = false;
mutex.lock();
if ( !findHost( host->hostName(), host->workgroupName() ) )
{
p->hostsList.append( host );
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,195 | bool Smb4KGlobal::addWorkgroup( Smb4KWorkgroup *workgroup )
{
Q_ASSERT( workgroup );
bool added = false;
mutex.lock();
if ( !findWorkgroup( workgroup->workgroupName() ) )
{
p->workgroupsList.append( workgroup );
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| +Priv | 0 | bool Smb4KGlobal::addWorkgroup( Smb4KWorkgroup *workgroup )
{
Q_ASSERT( workgroup );
bool added = false;
mutex.lock();
if ( !findWorkgroup( workgroup->workgroupName() ) )
{
p->workgroupsList.append( workgroup );
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,196 | void Smb4KGlobal::clearHostsList()
{
mutex.lock();
while ( !p->hostsList.isEmpty() )
{
delete p->hostsList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearHostsList()
{
mutex.lock();
while ( !p->hostsList.isEmpty() )
{
delete p->hostsList.takeFirst();
}
mutex.unlock();
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,197 | void Smb4KGlobal::clearSharesList()
{
mutex.lock();
while ( !p->sharesList.isEmpty() )
{
delete p->sharesList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearSharesList()
{
mutex.lock();
while ( !p->sharesList.isEmpty() )
{
delete p->sharesList.takeFirst();
}
mutex.unlock();
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,198 | void Smb4KGlobal::clearWorkgroupsList()
{
mutex.lock();
while ( !p->workgroupsList.isEmpty() )
{
delete p->workgroupsList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearWorkgroupsList()
{
mutex.lock();
while ( !p->workgroupsList.isEmpty() )
{
delete p->workgroupsList.takeFirst();
}
mutex.unlock();
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,199 | bool Smb4KGlobal::coreIsInitialized()
{
return p->coreInitialized;
}
| +Priv | 0 | bool Smb4KGlobal::coreIsInitialized()
{
return p->coreInitialized;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.