Introduction
Introduction Statistics Contact Development Disclaimer Help
applied some segfault patches of Adrien Krunch Kunysz (thanks to Adrien!) - sic…
git clone git://git.suckless.org/sic
Log
Files
Refs
README
LICENSE
---
commit 44e0417e14c2f0a59c8688cdaf6b7d485ff7bdea
parent 148029905b9d0a06333cb43834eb819385561ab5
Author: Anselm R. Garbe <[email protected]>
Date: Thu, 11 Jan 2007 11:35:02 +0100
applied some segfault patches of Adrien Krunch Kunysz (thanks to Adrien!)
Diffstat:
M sic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/sic.c b/sic.c
@@ -142,7 +142,8 @@ parsesrv(char *msg) {
* <crlf> ::= CR LF
*/
if(msg[0] == ':') { /* check prefix */
- p = strchr(msg, ' ');
+ if (!(p = strchr(msg, ' ')))
+ return;
*p = 0;
for(++p; *p == ' '; p++);
cmd = p;
@@ -162,7 +163,7 @@ parsesrv(char *msg) {
argv[Ttext] = ++p;
}
tokenize(&argv[Tcmd], Tlast - Tcmd, cmd, ' ');
- if(!strncmp("PONG", argv[Tcmd], 5))
+ if(!argv[Tcmd] || !strncmp("PONG", argv[Tcmd], 5))
return;
else if(!strncmp("PING", argv[Tcmd], 5)) {
snprintf(bufout, sizeof bufout, "PONG %s\r\n", argv[Ttext]);
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.