]>
Commit | Line | Data |
---|---|---|
3bd189cb JR |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> |
2 | <HTML> | |
3 | <HEAD> | |
4 | <TITLE> [IRCServices Coding] svcs5 | |
5 | </TITLE> | |
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"> | |
12 | </HEAD> | |
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 | |
18 | </A><BR> | |
19 | <I>Sun Dec 16 17:09:35 PST 2001</I> | |
20 | <P><UL> | |
21 | <LI>Previous message: <A HREF="000032.html">[IRCServices Coding] svcs5 | |
22 | </A></li> | |
23 | <LI>Next message: <A HREF="000041.html">[IRCServices Coding] Services 5 having problems to shut down | |
24 | </A></li> | |
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> | |
30 | </LI> | |
31 | </UL> | |
32 | <HR> | |
33 | <!--beginarticle--> | |
34 | <PRE>I don't understand this completely, but i get coredumps when | |
35 | doing /msg chanserv levels #chan set ignore 6 | |
36 | ||
37 | it seems that there is something wrong... | |
38 | ||
39 | in chanserv/util.c: | |
40 | ||
41 | ChannelInfo *makechan(const char *chan) | |
42 | { | |
43 | ChannelInfo *ci; | |
44 | ||
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); | |
50 | } | |
51 | ||
52 | i bellieve this should be: | |
53 | reset_levels(ci,1); | |
54 | ||
55 | ||
56 | also in chanserv/access.c: | |
57 | ||
58 | EXPORT_FUNC(reset_levels) | |
59 | void reset_levels(ChannelInfo *ci, int set) | |
60 | { | |
61 | int i; | |
62 | ||
63 | >>>>><i> free(ci->levels); <<<<< | |
64 | </I> if (set) { | |
65 | ci->levels = scalloc(CA_SIZE, sizeof(*ci->levels)); | |
66 | for (i = 0; i < CA_SIZE; i++) | |
67 | ci->levels[i] = def_levels[i]; | |
68 | } else { | |
69 | ci->levels = NULL; | |
70 | } | |
71 | } | |
72 | ||
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) | |
76 | ||
77 | ||
78 | finaly in chanserv/access-levels.c, in do_levels(): | |
79 | ||
80 | for (i = 0; levelinfo[i].what >= 0; i++) { | |
81 | if (stricmp(levelinfo[i].name, what) == 0) { | |
82 | if (ci->levels) | |
83 | reset_levels(ci, 1); | |
84 | >>>>><i> ci->levels[levelinfo[i].what] = level; <<<<<< | |
85 | </I> notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED, | |
86 | levelinfo[i].name, chan, level); | |
87 | put_channelinfo(ci); | |
88 | return; | |
89 | } | |
90 | } | |
91 | ||
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 | |
96 | ||
97 | (from gdb) (not wrapped) | |
98 | ||
99 | (gdb) bt | |
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 | |
110 | 319 } | |
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); | |
119 | 328 return; | |
120 | (gdb) p i | |
121 | $1 = 224 | |
122 | ||
123 | ||
124 | <<V13>> | |
125 | ||
126 | </PRE> | |
127 | ||
128 | <!--endarticle--> | |
129 | <HR> | |
130 | <P><UL> | |
131 | <!--threads--> | |
132 | <LI>Previous message: <A HREF="000032.html">[IRCServices Coding] svcs5 | |
133 | </A></li> | |
134 | <LI>Next message: <A HREF="000041.html">[IRCServices Coding] Services 5 having problems to shut down | |
135 | </A></li> | |
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> | |
141 | </LI> | |
142 | </UL> | |
143 | ||
144 | </body></html> |