gnome-keyring r1563 - in trunk: . daemon daemon/keyrings daemon/ui egg gcr library pam pkcs11/gck pkcs11/roots-store pkcs11/rpc-layer pkcs11/ssh-agent pkcs11/ssh-store pkcs11/user-store tests
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1563 - in trunk: . daemon daemon/keyrings daemon/ui egg gcr library pam pkcs11/gck pkcs11/roots-store pkcs11/rpc-layer pkcs11/ssh-agent pkcs11/ssh-store pkcs11/user-store tests
- Date: Fri, 13 Feb 2009 18:05:26 +0000 (UTC)
Author: nnielsen
Date: Fri Feb 13 18:05:26 2009
New Revision: 1563
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1563&view=rev
Log:
Use size_t and gsize for memory sizes rather than unsigned long.
Fixes bug #571615
Modified:
trunk/ChangeLog
trunk/daemon/gkr-daemon-io.c
trunk/daemon/gkr-daemon.c
trunk/daemon/keyrings/gkr-keyring.c
trunk/daemon/ui/gkr-ask-tool.c
trunk/egg/egg-buffer.h
trunk/egg/egg-secure-memory.c
trunk/egg/egg-secure-memory.h
trunk/gcr/gcr-library.c
trunk/library/gnome-keyring-memory.c
trunk/library/gnome-keyring-proto.c
trunk/pam/gkr-pam-stubs.c
trunk/pkcs11/gck/gck-data-types.h
trunk/pkcs11/roots-store/gck-roots-standalone.c
trunk/pkcs11/rpc-layer/gck-rpc-module.c
trunk/pkcs11/ssh-agent/gck-ssh-agent-standalone.c
trunk/pkcs11/ssh-store/gck-ssh-standalone.c
trunk/pkcs11/user-store/gck-user-standalone.c
trunk/tests/gtest-helpers.c
trunk/tests/test-helpers.c
Modified: trunk/daemon/gkr-daemon-io.c
==============================================================================
--- trunk/daemon/gkr-daemon-io.c (original)
+++ trunk/daemon/gkr-daemon-io.c Fri Feb 13 18:05:26 2009
@@ -287,7 +287,7 @@
/* Make sure keyrings in memory are up to date before doing anything */
gkr_keyrings_update ();
- egg_buffer_init_full (&client->output_buffer, 128, (EggBufferAllocator)g_realloc);
+ egg_buffer_init_full (&client->output_buffer, 128, g_realloc);
/* Add empty size */
egg_buffer_add_uint32 (&client->output_buffer, 0);
Modified: trunk/daemon/gkr-daemon.c
==============================================================================
--- trunk/daemon/gkr-daemon.c (original)
+++ trunk/daemon/gkr-daemon.c Fri Feb 13 18:05:26 2009
@@ -233,7 +233,7 @@
}
void*
-egg_memory_fallback (void *p, unsigned long sz)
+egg_memory_fallback (void *p, size_t sz)
{
const gchar *env;
@@ -465,7 +465,7 @@
if (egg_unix_credentials_write (sock) < 0)
return FALSE;
- egg_buffer_init_full (&buf, 128, (EggBufferAllocator)g_realloc);
+ egg_buffer_init_full (&buf, 128, g_realloc);
envp = gnome_keyring_build_environment (GNOME_KEYRING_IN_ENVIRONMENT);
ret = gkr_proto_encode_prepare_environment (&buf, (const gchar**)envp);
Modified: trunk/daemon/keyrings/gkr-keyring.c
==============================================================================
--- trunk/daemon/keyrings/gkr-keyring.c (original)
+++ trunk/daemon/keyrings/gkr-keyring.c Fri Feb 13 18:05:26 2009
@@ -441,7 +441,7 @@
if (!file)
return FALSE;
- egg_buffer_init_full (&out, 4096, (EggBufferAllocator)g_realloc);
+ egg_buffer_init_full (&out, 4096, g_realloc);
/* Generate it */
if (!keyring->password || !keyring->password[0])
Modified: trunk/daemon/ui/gkr-ask-tool.c
==============================================================================
--- trunk/daemon/ui/gkr-ask-tool.c (original)
+++ trunk/daemon/ui/gkr-ask-tool.c Fri Feb 13 18:05:26 2009
@@ -75,7 +75,7 @@
}
void*
-egg_memory_fallback (void *p, unsigned long sz)
+egg_memory_fallback (void *p, size_t sz)
{
const gchar *env;
Modified: trunk/egg/egg-buffer.h
==============================================================================
--- trunk/egg/egg-buffer.h (original)
+++ trunk/egg/egg-buffer.h Fri Feb 13 18:05:26 2009
@@ -55,7 +55,7 @@
*/
/* The allocator for the EggBuffer. This follows the realloc() syntax and logic */
-typedef void* (*EggBufferAllocator) (void* p, unsigned long len);
+typedef void* (*EggBufferAllocator) (void* p, size_t len);
typedef struct _EggBuffer {
unsigned char *buf;
Modified: trunk/egg/egg-secure-memory.c
==============================================================================
--- trunk/egg/egg-secure-memory.c (original)
+++ trunk/egg/egg-secure-memory.c Fri Feb 13 18:05:26 2009
@@ -617,7 +617,7 @@
*/
static void*
-sec_acquire_pages (unsigned long *sz)
+sec_acquire_pages (size_t *sz)
{
void *pages;
unsigned long pgsize;
@@ -664,7 +664,7 @@
}
static void
-sec_release_pages (void *pages, unsigned long sz)
+sec_release_pages (void *pages, size_t sz)
{
ASSERT (pages);
ASSERT (sz % getpagesize () == 0);
@@ -690,7 +690,7 @@
static Block *all_blocks = NULL;
static Block*
-sec_block_create (unsigned long size)
+sec_block_create (size_t size)
{
Block *block;
Cell *cell;
@@ -826,7 +826,7 @@
}
void*
-egg_secure_realloc_full (void *memory, unsigned long length, int flags)
+egg_secure_realloc_full (void *memory, size_t length, int flags)
{
Block *block = NULL;
size_t previous = 0;
@@ -971,7 +971,7 @@
char*
egg_secure_strdup (const char *str)
{
- unsigned long len;
+ size_t len;
char *res;
if (!str)
Modified: trunk/egg/egg-secure-memory.h
==============================================================================
--- trunk/egg/egg-secure-memory.h (original)
+++ trunk/egg/egg-secure-memory.h Fri Feb 13 18:05:26 2009
@@ -24,6 +24,8 @@
#ifndef EGG_SECURE_MEMORY_H
#define EGG_SECURE_MEMORY_H
+#include <stdlib.h>
+
/* -------------------------------------------------------------------
* Low Level Secure Memory
*
@@ -51,7 +53,7 @@
*
* Same call semantics as realloc with regard to NULL and zeros
*/
-extern void* egg_memory_fallback (void *p, unsigned long sz);
+extern void* egg_memory_fallback (void *p, size_t length);
/*
@@ -62,13 +64,13 @@
#define GKR_SECURE_USE_FALLBACK 0x0001
-void* egg_secure_alloc (unsigned long sz);
+void* egg_secure_alloc (size_t length);
-void* egg_secure_alloc_full (unsigned long, int flags);
+void* egg_secure_alloc_full (size_t length, int flags);
-void* egg_secure_realloc (void *p, unsigned long sz);
+void* egg_secure_realloc (void *p, size_t length);
-void* egg_secure_realloc_full (void *p, unsigned long sz, int fallback);
+void* egg_secure_realloc_full (void *p, size_t length, int fallback);
void egg_secure_free (void* p);
Modified: trunk/gcr/gcr-library.c
==============================================================================
--- trunk/gcr/gcr-library.c (original)
+++ trunk/gcr/gcr-library.c Fri Feb 13 18:05:26 2009
@@ -72,7 +72,7 @@
}
void*
-egg_memory_fallback (void *p, unsigned long sz)
+egg_memory_fallback (void *p, size_t sz)
{
const gchar *env;
Modified: trunk/library/gnome-keyring-memory.c
==============================================================================
--- trunk/library/gnome-keyring-memory.c (original)
+++ trunk/library/gnome-keyring-memory.c Fri Feb 13 18:05:26 2009
@@ -59,7 +59,7 @@
}
void*
-egg_memory_fallback (void *p, unsigned long sz)
+egg_memory_fallback (void *p, size_t sz)
{
const gchar *env;
Modified: trunk/library/gnome-keyring-proto.c
==============================================================================
--- trunk/library/gnome-keyring-proto.c (original)
+++ trunk/library/gnome-keyring-proto.c Fri Feb 13 18:05:26 2009
@@ -1441,8 +1441,7 @@
offset = 8;
- if (!egg_buffer_get_stringv (buffer, offset, &offset, environment,
- (EggBufferAllocator)g_realloc))
+ if (!egg_buffer_get_stringv (buffer, offset, &offset, environment, g_realloc))
return FALSE;
return TRUE;
Modified: trunk/pam/gkr-pam-stubs.c
==============================================================================
--- trunk/pam/gkr-pam-stubs.c (original)
+++ trunk/pam/gkr-pam-stubs.c Fri Feb 13 18:05:26 2009
@@ -43,7 +43,7 @@
}
void*
-egg_memory_fallback (void *p, unsigned long sz)
+egg_memory_fallback (void *p, size_t sz)
{
/* Handles allocation, reallocation and freeing */
return realloc (p, sz);
Modified: trunk/pkcs11/gck/gck-data-types.h
==============================================================================
--- trunk/pkcs11/gck/gck-data-types.h (original)
+++ trunk/pkcs11/gck/gck-data-types.h Fri Feb 13 18:05:26 2009
@@ -10,8 +10,6 @@
GCK_DATA_SUCCESS = 1
} GckDataResult;
-typedef void* (*GckDataAllocator) (void* p, unsigned long len);
-
#define GCK_DATA_ERROR (g_quark_from_static_string ("gck-data-error"))
#endif /* GCKDATA_H_ */
Modified: trunk/pkcs11/roots-store/gck-roots-standalone.c
==============================================================================
--- trunk/pkcs11/roots-store/gck-roots-standalone.c (original)
+++ trunk/pkcs11/roots-store/gck-roots-standalone.c Fri Feb 13 18:05:26 2009
@@ -39,7 +39,7 @@
{ g_static_mutex_lock (&memory_mutex); }
void egg_memory_unlock (void)
{ g_static_mutex_unlock (&memory_mutex); }
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{ return g_realloc (p, sz); }
CK_RV
Modified: trunk/pkcs11/rpc-layer/gck-rpc-module.c
==============================================================================
--- trunk/pkcs11/rpc-layer/gck-rpc-module.c (original)
+++ trunk/pkcs11/rpc-layer/gck-rpc-module.c Fri Feb 13 18:05:26 2009
@@ -208,7 +208,7 @@
/* Allocator for call session buffers */
static void*
-call_allocator (void* p, unsigned long sz)
+call_allocator (void* p, size_t sz)
{
void* res = realloc (p, (size_t)sz);
if (!res && sz)
Modified: trunk/pkcs11/ssh-agent/gck-ssh-agent-standalone.c
==============================================================================
--- trunk/pkcs11/ssh-agent/gck-ssh-agent-standalone.c (original)
+++ trunk/pkcs11/ssh-agent/gck-ssh-agent-standalone.c Fri Feb 13 18:05:26 2009
@@ -44,7 +44,7 @@
void egg_memory_unlock (void)
{ G_UNLOCK (memory_mutex); }
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{ return g_realloc (p, sz); }
static gboolean
Modified: trunk/pkcs11/ssh-store/gck-ssh-standalone.c
==============================================================================
--- trunk/pkcs11/ssh-store/gck-ssh-standalone.c (original)
+++ trunk/pkcs11/ssh-store/gck-ssh-standalone.c Fri Feb 13 18:05:26 2009
@@ -39,7 +39,7 @@
{ g_static_mutex_lock (&memory_mutex); }
void egg_memory_unlock (void)
{ g_static_mutex_unlock (&memory_mutex); }
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{ return g_realloc (p, sz); }
CK_RV
Modified: trunk/pkcs11/user-store/gck-user-standalone.c
==============================================================================
--- trunk/pkcs11/user-store/gck-user-standalone.c (original)
+++ trunk/pkcs11/user-store/gck-user-standalone.c Fri Feb 13 18:05:26 2009
@@ -39,7 +39,7 @@
{ g_static_mutex_lock (&memory_mutex); }
void egg_memory_unlock (void)
{ g_static_mutex_unlock (&memory_mutex); }
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{ return g_realloc (p, sz); }
CK_RV
Modified: trunk/tests/gtest-helpers.c
==============================================================================
--- trunk/tests/gtest-helpers.c (original)
+++ trunk/tests/gtest-helpers.c Fri Feb 13 18:05:26 2009
@@ -48,7 +48,7 @@
g_static_mutex_unlock (&memory_mutex);
}
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{
return g_realloc (p, sz);
}
Modified: trunk/tests/test-helpers.c
==============================================================================
--- trunk/tests/test-helpers.c (original)
+++ trunk/tests/test-helpers.c Fri Feb 13 18:05:26 2009
@@ -23,7 +23,7 @@
g_static_mutex_unlock (&memory_mutex);
}
-void* egg_memory_fallback (void *p, unsigned long sz)
+void* egg_memory_fallback (void *p, size_t sz)
{
return g_realloc (p, sz);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]