[launchd-changes] [23210] trunk/launchd/src/launchd_core_logic.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Apr 6 15:11:15 PDT 2007
Revision: 23210
http://trac.macosforge.org/projects/launchd/changeset/23210
Author: zarzycki at apple.com
Date: 2007-04-06 15:11:15 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Fix another memory smasher.
Modified Paths:
--------------
trunk/launchd/src/launchd_core_logic.c
Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c 2007-04-06 22:00:11 UTC (rev 23209)
+++ trunk/launchd/src/launchd_core_logic.c 2007-04-06 22:11:15 UTC (rev 23210)
@@ -1016,7 +1016,8 @@
char auto_label[1000];
char *bn = NULL;
char *co;
- int minlabel_len, i, cc = 0;
+ size_t minlabel_len;
+ int i, cc = 0;
job_t j;
launchd_assert(offsetof(struct job_s, kqjob_callback) == 0);
@@ -1038,9 +1039,10 @@
}
/* This is so we can do gross things later. See NOTE_EXEC for anonymous jobs */
+#define MAX_ANONYMOUS_LABEL_LEN (sizeof("anonymous-100000.") + MAXCOMLEN)
minlabel_len = strlen(label);
- if (minlabel_len < MAXCOMLEN) {
- minlabel_len = MAXCOMLEN;
+ if (minlabel_len < MAX_ANONYMOUS_LABEL_LEN) {
+ minlabel_len = MAX_ANONYMOUS_LABEL_LEN;
}
j = calloc(1, sizeof(struct job_s) + minlabel_len + 1);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070406/e8830aaa/attachment.html
More information about the launchd-changes
mailing list