Index: /pjproject/branches/pjproject-0.5-stable/pjlib-util/src/pjlib-util/resolver.c
===================================================================
--- /pjproject/branches/pjproject-0.5-stable/pjlib-util/src/pjlib-util/resolver.c	(revision 1307)
+++ /pjproject/branches/pjproject-0.5-stable/pjlib-util/src/pjlib-util/resolver.c	(revision 1308)
@@ -126,6 +126,6 @@
 
     struct res_key	 key;		/**< Key to index this query.	    */
-    char		 hbufid[PJ_HASH_ENTRY_SIZE];	/**< Hash buffer 1  */
-    char		 hbufkey[PJ_HASH_ENTRY_SIZE];	/**< Hash buffer 2  */
+    pj_hash_entry_buf	 hbufid;	/**< Hash buffer 1		    */
+    pj_hash_entry_buf	 hbufkey;	/**< Hash buffer 2		    */
     pj_timer_entry	 timer_entry;	/**< Timer to manage timeouts	    */
     unsigned		 options;	/**< Query options.		    */
@@ -145,5 +145,5 @@
     struct res_key	     key;	    /**< Resource key.		    */
     char		     buf[RES_BUF_SZ];/**< Resource buffer.	    */
-    char		     hbuf[PJ_HASH_ENTRY_SIZE];	/**< Hash buffer    */
+    pj_hash_entry_buf	     hbuf;	    /**< Hash buffer		    */
     pj_time_val		     expiry_time;   /**< Expiration time.	    */
     pj_dns_parsed_packet    *pkt;	    /**< The response packet.	    */
Index: /pjproject/branches/pjproject-0.5-stable/pjlib/include/pj/hash.h
===================================================================
--- /pjproject/branches/pjproject-0.5-stable/pjlib/include/pj/hash.h	(revision 1307)
+++ /pjproject/branches/pjproject-0.5-stable/pjlib/include/pj/hash.h	(revision 1308)
@@ -48,5 +48,10 @@
  * This indicates the size of of each hash entry.
  */
-#define PJ_HASH_ENTRY_SIZE	(3*sizeof(void*) + 2*sizeof(pj_uint32_t))
+#define PJ_HASH_ENTRY_BUF_SIZE	(3*sizeof(void*) + 2*sizeof(pj_uint32_t))
+
+/**
+ * Type declaration for entry buffer, used by #pj_hash_set_np()
+ */
+typedef void *pj_hash_entry_buf[(PJ_HASH_ENTRY_BUF_SIZE+sizeof(void*)-1)/(sizeof(void*))];
 
 /**
@@ -148,10 +153,6 @@
  *		    compute the key. This value can be obtained when calling
  *		    #pj_hash_get().
- * @param entry_buf Pointer to buffer which will be used for the new entry,
- *		    when one needs to be created. The buffer must be at least
- *		    PJ_HASH_ENTRY_SIZE long, and the first PJ_HASH_ENTRY_SIZE
- *		    bytes of the buffer will be used by the hash table.
- *		    Application may use the remaining portion of the buffer
- *		    for its own purpose.
+ * @param entry_buf Buffer which will be used for the new entry, when one needs
+ *		    to be created.
  * @param value	    value to be associated, or NULL to delete the entry with
  *		    the specified key.
@@ -159,5 +160,6 @@
 PJ_DECL(void) pj_hash_set_np(pj_hash_table_t *ht,
 			     const void *key, unsigned keylen, 
-			     pj_uint32_t hval, void *entry_buf, void *value);
+			     pj_uint32_t hval, pj_hash_entry_buf entry_buf, 
+			     void *value);
 
 /**
Index: /pjproject/branches/pjproject-0.5-stable/pjlib/src/pj/hash.c
===================================================================
--- /pjproject/branches/pjproject-0.5-stable/pjlib/src/pj/hash.c	(revision 1307)
+++ /pjproject/branches/pjproject-0.5-stable/pjlib/src/pj/hash.c	(revision 1308)
@@ -101,6 +101,6 @@
     unsigned table_size;
     
-    /* Check that PJ_HASH_ENTRY_SIZE is correct. */
-    PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL);
+    /* Check that PJ_HASH_ENTRY_BUF_SIZE is correct. */
+    PJ_ASSERT_RETURN(sizeof(pj_hash_entry)<=PJ_HASH_ENTRY_BUF_SIZE, NULL);
 
     h = pj_pool_alloc(pool, sizeof(pj_hash_table_t));
@@ -237,9 +237,11 @@
 PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht,
 			     const void *key, unsigned keylen, 
-			     pj_uint32_t hval, void *entry_buf, void *value)
+			     pj_uint32_t hval, pj_hash_entry_buf entry_buf, 
+			     void *value)
 {
     pj_hash_entry **p_entry;
 
-    p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf );
+    p_entry = find_entry( NULL, ht, key, keylen, value, &hval, 
+			 (void*)entry_buf );
     if (*p_entry) {
 	if (value == NULL) {
Index: /pjproject/branches/pjproject-0.5-stable/pjsip/src/pjsip/sip_ua_layer.c
===================================================================
--- /pjproject/branches/pjproject-0.5-stable/pjsip/src/pjsip/sip_ua_layer.c	(revision 1307)
+++ /pjproject/branches/pjproject-0.5-stable/pjsip/src/pjsip/sip_ua_layer.c	(revision 1308)
@@ -63,5 +63,5 @@
 
     /* This is the buffer to store this entry in the hash table. */
-    char ht_entry[PJ_HASH_ENTRY_SIZE];
+    pj_hash_entry_buf ht_entry;
 
     /* List of dialog in this dialog set. */
