blob: dcd9453c083ed6d414e2079e69ff843fe1b156be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
$NetBSD: patch-am,v 1.1 2005/01/31 17:33:57 drochner Exp $
--- camel/camel-lock-helper.c.orig 2001-11-03 01:26:18.000000000 +0100
+++ camel/camel-lock-helper.c
@@ -360,8 +360,9 @@ int main(int argc, char **argv)
switch(msg.id) {
case CAMEL_LOCK_HELPER_LOCK:
res = CAMEL_LOCK_HELPER_STATUS_NOMEM;
- path = malloc(msg.data+1);
- if (path != NULL) {
+ if (msg.data > 0xffff) {
+ res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
+ } else if ((path = malloc(msg.data+1)) != NULL) {
res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
len = read_n(STDIN_FILENO, path, msg.data);
if (len == msg.data) {
|