]> git.armaanb.net Git - slock.git/commitdiff
fixed a potential buffer overflow bug on the stack (thanks to Ghassan Misherg)
authorAnselm R. Garbe <arg@suckless.org>
Sat, 13 Jan 2007 13:09:41 +0000 (14:09 +0100)
committerAnselm R. Garbe <arg@suckless.org>
Sat, 13 Jan 2007 13:09:41 +0000 (14:09 +0100)
LICENSE
Makefile
config.mk
slock.c

diff --git a/LICENSE b/LICENSE
index aa0a3abe98b24ac0fc1e123610ff1542a6fd56bb..3646c7dadfbe7dba2e806f33fb4c28292871f1ce 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 MIT/X Consortium License
 
-(C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
+(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
index a84e889f4b2cf88e77886a8d0720807a35cfac17..2254925e414925047a56d23af3354ce46ee1cc11 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 # slock - simple screen locker
-#   (C)opyright MMVI Anselm R. Garbe
+#   (C)opyright MMVI-MMVII Anselm R. Garbe
 
 include config.mk
 
index df3b2dc5a083ff8b69d4cf092aee647daf34d940..22a15859700b57b7dbcdf1b1d622c027f684e3da 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # slock version
-VERSION = 0.3
+VERSION = 0.4
 
 # Customize below to fit your system
 
diff --git a/slock.c b/slock.c
index aafc7c0a765bfb3504e4908c931fb9cff9adbb47..94cb26ba61c3fa76a6ab448c99ea097cd87bcdaa 100644 (file)
--- a/slock.c
+++ b/slock.c
@@ -1,4 +1,4 @@
-/* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
+/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
  * See LICENSE file for license details.
  */
 #define _XOPEN_SOURCE 500
@@ -122,7 +122,7 @@ main(int argc, char **argv) {
                                        --len;
                                break;
                        default:
-                               if(num && !iscntrl((int) buf[0])) {
+                               if(num && !iscntrl((int) buf[0]) && (len + num < sizeof passwd)) { 
                                        memcpy(passwd + len, buf, num);
                                        len += num;
                                }