2 Mar 2005 16:47
cygstart patch
Derosa, Anthony CIV NAVAIR 2035, 2, 205/214 <Anthony.Derosa1 <at> navy.mil>
2005-03-02 15:47:40 GMT
2005-03-02 15:47:40 GMT
I found a small bug and added a feature to the cygstart utility, which is part of the cygutils package. The
feature that I added removes the limit on the length of the command line arguments passed to the target
application, which was previously limited to MAX_PATH. The bug I fixed was in regard to freeing the
variable "args" instead of tyring to free "workDir" twice. A patch and change log follow below. As this is
my first contribution, please correct me if I did something incorrectly.
-Anthony
Change Log
2005-03-02 Anthony DeRosa <Anthony dot DeRosa dot 1 at navy dot mil>
* cygstart.c (main): removed limit on the length of command line arguments passed to the target application
* cygstart.c (main): fixed typo that freed the variable "workDir" twice instead of freeing "args"
Patch
--- ../cygutils-1.2.6/src/cygstart/cygstart.c 2002-03-16 00:49:44.000000000 -0500
+++ src/cygstart/cygstart.c 2005-03-02 09:16:00.383625000 -0500
<at> <at> -340,14 +340,18 <at> <at> int main(int argc, const char **argv)
/* Retrieve any arguments */
if (rest && *rest) {
- if ((args = (char *) malloc(MAX_PATH+1)) == NULL) {
+ if ((args = (char *) malloc(strlen(*rest)+1)) == NULL) {
fprintf(stderr, "%s: memory allocation error\n", argv[0]);
exit(1);
- }
- strncpy(args, *rest, MAX_PATH);
(Continue reading)
RSS Feed