commit | e6335e4dcf347352541cc52b9bea7841168710c9 | [log] [tgz] |
---|---|---|
author | Brian Silverman <brians> | Thu Feb 20 20:53:06 2014 -0800 |
committer | Brian Silverman <brians> | Thu Feb 20 20:53:06 2014 -0800 |
tree | 91feb8e3fc21403eeaade1285988e6e9f7f4e1ad | |
parent | c1a244e600a9c29b7227c65338c7c4640198c715 [diff] [blame] |
fixed some memory safety bugs
diff --git a/aos/linux_code/configuration.cc b/aos/linux_code/configuration.cc index e5e5583..6b1cdf6 100644 --- a/aos/linux_code/configuration.cc +++ b/aos/linux_code/configuration.cc
@@ -78,7 +78,7 @@ r, size, errno, strerror(errno)); } if (ret < size) { - void *last_slash = memrchr(r, '/', size); + void *last_slash = memrchr(r, '/', ret); if (last_slash == NULL) { r[ret] = '\0'; LOG(FATAL, "couldn't find a '/' in \"%s\"\n", r);