View | Details | Raw Unified | Return to bug 121097
Collapse All | Expand All

(-)psybnc.new/src/p_blowfish.c (-2 / +8 lines)
Lines 27-42 Link Here
27
static char rcsid[] = "@(#)$Id: p_blowfish.c,v 1.3 2005/06/04 18:00:14 hisi Exp $";
27
static char rcsid[] = "@(#)$Id: p_blowfish.c,v 1.3 2005/06/04 18:00:14 hisi Exp $";
28
#endif
28
#endif
29
29
30
#include <p_global.h>
31
/*
30
#include <stdio.h>
32
#include <stdio.h>
31
#include <string.h>
33
#include <string.h>
32
#include <config.h>
34
#include <config.h>
33
35
34
char *strmncpy(char *dest, char *source, size_t len);
36
char *strmncpy(char *dest, char *source, size_t len);
35
char *lngtxt(int msgnum);
37
char *lngtxt(int msgnum);
38
*/
36
39
40
/*
37
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
41
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
38
#define pmalloc(n) __pmalloc((n),__FILE__,__FUNCTION__,__LINE__)
42
#define pmalloc(n) __pmalloc((n),__FILE__,__FUNCTION__,__LINE__)
39
#define free(n) _pfree(n,__FILE__,__FUNCTION__,__LINE__)
43
#define free(n) _pfree(n,__FILE__,__FUNCTION__,__LINE__)
44
*/
40
45
41
unsigned char *hashstring(unsigned char *str,int len);
46
unsigned char *hashstring(unsigned char *str,int len);
42
unsigned char *unhashstring(unsigned char *str);
47
unsigned char *unhashstring(unsigned char *str);
Lines 478-487 Link Here
478
   char *p, *s, *dest, *d, *pt;
483
   char *p, *s, *dest, *d, *pt;
479
   char rim[5],ep[5],rep[5];
484
   char rim[5],ep[5],rep[5];
480
   int i;
485
   int i;
481
   dest = (char *) pmalloc((strlen(str) + 9) * 2);
486
   dest = __pmalloc((strlen(str) + 9) * 2, "p_blowfish.c", "BLOWencrypt", 481);
487
   dest = pmalloc((strlen(str) + 9) * 2);
482
   *dest=0;
488
   *dest=0;
483
   /* pad fake string with 8 bytes to make sure there's enough */
489
   /* pad fake string with 8 bytes to make sure there's enough */
484
   s = (char *) pmalloc(strlen(str) + 9);
490
   s =  pmalloc(strlen(str) + 9);
485
   strcpy(s, str);
491
   strcpy(s, str);
486
   p = s;
492
   p = s;
487
   while (*p)
493
   while (*p)
(-)psybnc.new/src/p_global.h (-3 / +3 lines)
Lines 972-978 Link Here
972
#endif
972
#endif
973
973
974
#ifndef P_MEMORY
974
#ifndef P_MEMORY
975
unsigned long *__pmalloc(unsigned long size,char *module,char *function,int line);
975
char *__pmalloc(unsigned long size,char *module,char *function,int line);
976
void _pfree(void * pointer,char *module, char *function, int line);
976
void _pfree(void * pointer,char *module, char *function, int line);
977
struct usert *user(int usern);
977
struct usert *user(int usern);
978
struct newpeert *newpeer(int usern);
978
struct newpeert *newpeer(int usern);
Lines 1267-1274 Link Here
1267
1267
1268
#endif
1268
#endif
1269
1269
1270
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt)); strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
1270
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt)); strmncpy(cfunc,(char*)__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
1271
#define pmalloc(n) __pmalloc((n),__FILE__,__FUNCTION__,__LINE__)
1271
#define pmalloc(n) __pmalloc((n),__FILE__,(char*)__FUNCTION__,(int)__LINE__)
1272
1272
1273
#define SSLCERT "key/psybnc.cert.pem"
1273
#define SSLCERT "key/psybnc.cert.pem"
1274
#define SSLKEY "key/psybnc.key.pem"
1274
#define SSLKEY "key/psybnc.key.pem"
(-)psybnc.new/src/p_idea.c (-1 / +4 lines)
Lines 50-55 Link Here
50
 * string encryption by psychoid
50
 * string encryption by psychoid
51
 */
51
 */
52
52
53
54
#include <p_global.h>
55
/*
53
#include <time.h>
56
#include <time.h>
54
#include <string.h>
57
#include <string.h>
55
#include <stdlib.h>
58
#include <stdlib.h>
Lines 62-68 Link Here
62
65
63
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
66
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
64
#define pmalloc(n) __pmalloc((n),__FILE__,__FUNCTION__,__LINE__)
67
#define pmalloc(n) __pmalloc((n),__FILE__,__FUNCTION__,__LINE__)
65
68
*/
66
#ifdef CRYPT
69
#ifdef CRYPT
67
70
68
#define IDEAROUNDS 8
71
#define IDEAROUNDS 8
(-)psybnc.new/src/p_memory.c (-5 / +5 lines)
Lines 32-41 Link Here
32
32
33
/* malloc-wrapper. No memory will log an error entry and kill the bouncer */
33
/* malloc-wrapper. No memory will log an error entry and kill the bouncer */
34
34
35
unsigned long *__pmalloc(unsigned long size,char *module,char *function, int line)
35
char *__pmalloc(unsigned long size,char *module,char *function, int line)
36
{
36
{
37
    unsigned long *rc;
37
    char *rc;
38
    if (!(rc=(unsigned long *)malloc(size)))
38
    if (!(rc=(char *)malloc(size)))
39
    {
39
    {
40
	p_log(LOG_ERROR,-1,lngtxt(602),module,function,line);
40
	p_log(LOG_ERROR,-1,lngtxt(602),module,function,line);
41
	exit(0x0);
41
	exit(0x0);
Lines 53-59 Link Here
53
    return rc;
53
    return rc;
54
}
54
}
55
55
56
void _pfree(unsigned long *pointer, char *module, char *function, int line)
56
void _pfree(char *pointer, char *module, char *function, int line)
57
{
57
{
58
#ifdef LOGALLOC
58
#ifdef LOGALLOC
59
    if(logm==NULL)
59
    if(logm==NULL)
Lines 67-73 Link Here
67
    free(pointer);
67
    free(pointer);
68
}
68
}
69
69
70
#define free(a) _pfree((void *)a,__FILE__,__FUNCTION__,__LINE__)
70
#define free(a) _pfree((void *)a,__FILE__,(char*)__FUNCTION__,__LINE__)
71
71
72
/* struct wrappers. Those alloc, delete and return the needed structures */
72
/* struct wrappers. Those alloc, delete and return the needed structures */

Return to bug 121097