Introduction
Introduction Statistics Contact Development Disclaimer Help
Eroding GCC4 and OpenBSD ideology warnings. - geomyidae - A small C-based gophe…
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit 500a99769e8db0b627a376b311c5436367192817
parent afc242d83cb480ecd0ec09f0dd43f3389df73f89
Author: Christoph Lohmann <[email protected]>
Date: Wed, 2 Mar 2011 16:10:09 +0100
Eroding GCC4 and OpenBSD ideology warnings.
Diffstat:
M handlr.c | 2 +-
M ind.c | 7 +++++--
M main.c | 8 ++++----
3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/handlr.c b/handlr.c
@@ -188,7 +188,7 @@ handlecgi(int sock, char *file, char *port, char *base, cha…
if(sear == nil)
sear = "";
- execl(file, p, sear, args, nil);
+ execl(file, p, sear, args, (char *)nil);
close(sock);
return;
diff --git a/ind.c b/ind.c
@@ -142,11 +142,14 @@ freeindex(Indexs *i)
void
addelem(Elems *e, char *s)
{
+ int slen;
+
+ slen = strlen(s) + 1;
e->num++;
e->e = realloc(e->e, sizeof(char *) * e->num);
- e->e[e->num - 1] = gmallocz(strlen(s) + 1, 0);
- strcpy(e->e[e->num - 1], s);
+ e->e[e->num - 1] = gmallocz(slen, 0);
+ strncpy(e->e[e->num - 1], s, slen - 1);
return;
}
diff --git a/main.c b/main.c
@@ -133,9 +133,9 @@ handlerequest(int sock, char *base, char *ohost, char *port…
int len, fd;
filetype *type;
- memset(&dir, 0, sizeof(dir));
- memset(recvb, 0, sizeof(recvb));
- memset(recvc, 0, sizeof(recvc));
+ bzero(&dir, sizeof(dir));
+ bzero(recvb, sizeof(recvb));
+ bzero(recvc, sizeof(recvc));
len = recv(sock, recvb, sizeof(recvb), 0);
if(len > 1) {
@@ -144,7 +144,7 @@ handlerequest(int sock, char *base, char *ohost, char *port…
if(recvb[len - 1] == '\n')
recvb[len - 1] = '\0';
}
- strcpy(recvc, recvb);
+ strncpy(recvc, recvb, sizeof(recvc) - 1);
if(!strncmp(recvb, "URL:", 4)) {
len = snprintf(path, sizeof(path), htredir,
You are viewing proxied material from bitreich.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.