diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-01-13 14:09:41 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-01-13 14:09:41 +0100 |
commit | 6725bb2a3a425ffff9c2253d60c0f25513c78a93 (patch) | |
tree | 47d0689fc98e1527f98bf86c2be408da7c1fc5d4 | |
parent | 11642443f520a3f7fe6ecfd7411bf18b3f2081d3 (diff) |
fixed a potential buffer overflow bug on the stack (thanks to Ghassan Misherg)
-rw-r--r-- | LICENSE | 2 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | slock.c | 4 |
4 files changed, 5 insertions, 5 deletions
@@ -1,6 +1,6 @@ | |||
1 | MIT/X Consortium License | 1 | MIT/X Consortium License |
2 | 2 | ||
3 | (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | 3 | (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> |
4 | 4 | ||
5 | Permission is hereby granted, free of charge, to any person obtaining a | 5 | Permission is hereby granted, free of charge, to any person obtaining a |
6 | copy of this software and associated documentation files (the "Software"), | 6 | copy of this software and associated documentation files (the "Software"), |
@@ -1,5 +1,5 @@ | |||
1 | # slock - simple screen locker | 1 | # slock - simple screen locker |
2 | # (C)opyright MMVI Anselm R. Garbe | 2 | # (C)opyright MMVI-MMVII Anselm R. Garbe |
3 | 3 | ||
4 | include config.mk | 4 | include config.mk |
5 | 5 | ||
@@ -1,5 +1,5 @@ | |||
1 | # slock version | 1 | # slock version |
2 | VERSION = 0.3 | 2 | VERSION = 0.4 |
3 | 3 | ||
4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
5 | 5 | ||
@@ -1,4 +1,4 @@ | |||
1 | /* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com> | 1 | /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> |
2 | * See LICENSE file for license details. | 2 | * See LICENSE file for license details. |
3 | */ | 3 | */ |
4 | #define _XOPEN_SOURCE 500 | 4 | #define _XOPEN_SOURCE 500 |
@@ -122,7 +122,7 @@ main(int argc, char **argv) { | |||
122 | --len; | 122 | --len; |
123 | break; | 123 | break; |
124 | default: | 124 | default: |
125 | if(num && !iscntrl((int) buf[0])) { | 125 | if(num && !iscntrl((int) buf[0]) && (len + num < sizeof passwd)) { |
126 | memcpy(passwd + len, buf, num); | 126 | memcpy(passwd + len, buf, num); |
127 | len += num; | 127 | len += num; |
128 | } | 128 | } |