summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-29 09:55:03 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-29 09:55:03 +0200
commit99fc8282bd98a9d01429ad7520b603baf89994c2 (patch)
tree830c5358d8e88583eb2f17e602161943182d2626 /src
parent0b7149acccd0b6eb25f9ad44b02f04a73133f113 (diff)
downloadedoors-99fc8282bd98a9d01429ad7520b603baf89994c2.zip
edoors-99fc8282bd98a9d01429ad7520b603baf89994c2.tar.gz
fix buffer overflow detection
Diffstat (limited to 'src')
-rw-r--r--src/lib/eiotas_iota.c2
-rw-r--r--src/lib/eiotas_particle.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/eiotas_iota.c b/src/lib/eiotas_iota.c
index 1a1f7f8..a0a4f02 100644
--- a/src/lib/eiotas_iota.c
+++ b/src/lib/eiotas_iota.c
@@ -40,7 +40,7 @@ int eiotas_iota_init(Eiotas_Iota *iota, const char *name, Eiotas_Iota *parent, E
if(parent) {
lp = eina_stringshare_strlen(parent->path);
if((ln+lp+2)>EIOTAS_MAX_PATH_LENGTH) {
- ERR("path length %d is > EIOTAS_MAX_PATH_LENGTH (%d)",(ln+lp+2),EIOTAS_MAX_PATH_LENGTH);
+ ERR("buffer overflow (%d)",(ln+lp+2));
return 1;
}
memcpy(tmp,parent->path,lp);
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c
index e1d8433..18fbdb5 100644
--- a/src/lib/eiotas_particle.c
+++ b/src/lib/eiotas_particle.c
@@ -104,8 +104,8 @@ EAPI void eiotas_particle_add_destinations(Eiotas_Particle *particle, char* dest
n = (sep-dst);
if(n==0) {
ERR("ignore empty destination");
- } else if(n+2>EIOTAS_MAX_PATH_LENGTH) {
- ERR("buffer overflow (%d)",n);
+ } else if(n+1>EIOTAS_MAX_PATH_LENGTH) {
+ ERR("buffer overflow (%d)",n+1);
} else {
memcpy(tmp,dst,n);
tmp[n]='\0';