1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2//EN">
4 <TITLE> [IRCServices Coding] svcs5
6 <LINK REL=
"Index" HREF=
"index.html" >
7 <LINK REL=
"made" HREF=
"mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20svcs5&In-Reply-To=">
8 <META NAME=
"robots" CONTENT=
"index,nofollow">
9 <META http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
10 <LINK REL=
"Previous" HREF=
"000032.html">
11 <LINK REL=
"Next" HREF=
"000041.html">
13 <BODY BGCOLOR=
"#ffffff">
14 <H1>[IRCServices Coding] svcs5
</H1>
15 <B>v13 at priest.com
</B>
16 <A HREF=
"mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20svcs5&In-Reply-To="
17 TITLE=
"[IRCServices Coding] svcs5">v13 at priest.com
19 <I>Sun Dec
16 17:
09:
35 PST
2001</I>
21 <LI>Previous message:
<A HREF=
"000032.html">[IRCServices Coding] svcs5
23 <LI>Next message:
<A HREF=
"000041.html">[IRCServices Coding] Services
5 having problems to shut down
25 <LI> <B>Messages sorted by:
</B>
26 <a href=
"date.html#39">[ date ]
</a>
27 <a href=
"thread.html#39">[ thread ]
</a>
28 <a href=
"subject.html#39">[ subject ]
</a>
29 <a href=
"author.html#39">[ author ]
</a>
34 <PRE>I don't understand this completely, but i get coredumps when
35 doing /msg chanserv levels #chan set ignore
6
37 it seems that there is something wrong...
41 ChannelInfo *makechan(const char *chan)
45 ci = scalloc(sizeof(ChannelInfo),
1);
46 strscpy(ci-
>name, chan, CHANMAX);
47 ci-
>time_registered = time(NULL);
48 >>>>><i> reset_levels(ci,
0);
<<<<<<
49 </I> return add_channelinfo(ci);
52 i bellieve this should be:
56 also in chanserv/access.c:
58 EXPORT_FUNC(reset_levels)
59 void reset_levels(ChannelInfo *ci, int set)
63 >>>>><i> free(ci-
>levels);
<<<<<
65 ci-
>levels = scalloc(CA_SIZE, sizeof(*ci-
>levels));
66 for (i =
0; i
< CA_SIZE; i++)
67 ci-
>levels[i] = def_levels[i];
73 this may try to free something that is not malloced (if i get this right)
74 when it is called from makechan() (free(NULL) works under glibc, but i don't
75 know how portable/standard it is)
78 finaly in chanserv/access-levels.c, in do_levels():
80 for (i =
0; levelinfo[i].what
>=
0; i++) {
81 if (stricmp(levelinfo[i].name, what) ==
0) {
84 >>>>><i> ci-
>levels[levelinfo[i].what] = level;
<<<<<<
85 </I> notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
86 levelinfo[i].name, chan, level);
92 the marked line is where i get the coredump...
93 it doesn't make any sense..
94 if ci-
>levels is NULL, then reset_levels is not called...
95 so it remains NULL and then ci-
>levels[] is used
97 (from gdb) (not wrapped)
100 #
0 do_levels (u=
0x814cf0c) at access-levels.c:
324
101 #
1 0x0804df4c in run_cmd (service=
0x8144bd4 "ChanServ
", u=
0x814cf0c, id=
0x81449c4, cmd=
0xbffff5f2 "levels
") at commands.c:
158
102 #
2 0x401a0070 in chanserv (source=
0xbffff820 "V13
", target=
0xbffff5e8 "chanserv
", buf=
0xbffff5f2 "levels
") at main.c:
226
103 #
3 0x08054cba in call_callback_5 (module=
0x0, id=
25, arg1=
0xbffff820, arg2=
0xbffff5e8, arg3=
0xbffff5f2, arg4=
0x0, arg5=
0x0) at modules.c:
605
104 #
4 0x08052f3f in m_privmsg (source=
0xbffff820 "V13
", ac=
2, av=
0x814cd8c) at messages.c:
169
105 #
5 0x08055260 in process () at process.c:
131
106 #
6 0x08056395 in check_sockets () at sockets.c:
362
107 #
7 0x080526cc in main (ac=
3, av=
0xbffffa54, envp=
0xbffffa64) at main.c:
377
108 #
8 0x4004d823 in __libc_start_main () from /lib/libc.so
.6
109 (gdb) l access-levels.c:
324
111 320 for (i =
0; levelinfo[i].what
>=
0; i++) {
112 321 if (stricmp(levelinfo[i].name, what) ==
0) {
113 322 if (ci-
>levels)
114 323 reset_levels(ci,
1);
115 324 ci-
>levels[levelinfo[i].what] = level;
116 325 notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
117 326 levelinfo[i].name, chan, level);
118 327 put_channelinfo(ci);
132 <LI>Previous message:
<A HREF=
"000032.html">[IRCServices Coding] svcs5
134 <LI>Next message:
<A HREF=
"000041.html">[IRCServices Coding] Services
5 having problems to shut down
136 <LI> <B>Messages sorted by:
</B>
137 <a href=
"date.html#39">[ date ]
</a>
138 <a href=
"thread.html#39">[ thread ]
</a>
139 <a href=
"subject.html#39">[ subject ]
</a>
140 <a href=
"author.html#39">[ author ]
</a>