Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2002 23:40:03 -0800 (PST)
From:      John Merryweather Cooper <john_m_cooper@yahoo.com>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/36277: [MAINTAINER UPDATE] Update www/plugger to plugger-4.0
Message-ID:  <200203250740.g2P7e3L61240@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/36277; it has been noted by GNATS.

From: John Merryweather Cooper <john_m_cooper@yahoo.com>
To: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Cc:  
Subject: Re: ports/36277: [MAINTAINER UPDATE] Update www/plugger to
	plugger-4.0
Date: 24 Mar 2002 23:31:58 -0800

 --=-piIMQ5GyQfnNxE6LyrJa
 Content-Type: text/plain
 Content-Transfer-Encoding: 7bit
 
 Minor "OOPS" in patch-plugger-helper.c:  things will run o.k. (most of
 the time), but the length parameter is off for two of the snprintf()
 calls.  See attached, updated patch-plugger-helper.c for the correct
 version.
 -- 
          _
   | |V| / '                       ||  MacroHard --                   \
 \_| | | \_,                       ||     the perfection of form over |
 ----------------------------------||     substance, marketing over   |
 Web:  http://www.borgsdemons.com  ||     performance, and greed over |
 AIM:  johnmcooper                 ||     design . . .                |
 =====================================================================/
 Public Key:  http://www.borgsdemons.com/Personal/pgpkey.asc          |
 =====================================================================\
 
 --=-piIMQ5GyQfnNxE6LyrJa
 Content-Disposition: attachment; filename=patch-plugger-helper.c
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/x-c; charset=ISO-8859-1
 
 --- plugger-helper.c.orig	Sun Dec  9 22:41:11 2001
 +++ plugger-helper.c	Sun Mar 24 23:29:20 2002
 @@ -30,6 +30,7 @@
  #include <sys/stat.h>
  #include <sys/wait.h>
  #include <errno.h>
 +#include <stdlib.h>
  #include <sys/time.h>
  #include <X11/X.h>
  #include <X11/Xos.h>
 @@ -355,10 +356,10 @@
  	/* Time to steal the lock! */
  	mode=3DPropModeReplace;
  	gettimeofday(&tv, 0);
 -	INC_TIME(&tv, 0, 10000 + (rand() & 16383));
 +	INC_TIME(&tv, 0, 10000 + (random() & 16383));
  	break;
        }
 -      my_usleep((rand() & 16383) + 2000); /* 0.18383 seconds */
 +      my_usleep((random() & 16383) + 2000); /* 0.18383 seconds */
      }
     =20
      D("XChangeProperty, mode=3D%d\n",mode);
 @@ -401,6 +402,7 @@
    got_sigwinch=3D1;
  }
 =20
 +#define LONG_CHARS  12
 =20
  int main(int argc, char **argv)
  {
 @@ -493,30 +495,30 @@
  	loops=3DMIN(repeats,10);
  	for(e=3D0;e<loops;e++)
  	{
 -	  strcat(foo," ");
 -	  strcat(foo,file);
 +	  strncat(foo," ", 1);
 +	  strncat(foo,file,strlen(file));
  	}
        }else{
 -	sprintf(foo,"file=3D%s",file);
 +	snprintf(foo,strlen(file)+1+5,"file=3D%s",file);
        }
        putenv(foo);
        foo+=3Dstrlen(foo)+1;
      }
 =20
      /* setup environment variable $env */
 -    sprintf(foo,"window=3D%ld",(long)WINDOW);
 +    snprintf(foo,LONG_CHARS+7+1,"window=3D%ld",(long)WINDOW);
      putenv(foo);
      foo+=3Dstrlen(foo)+1;
 =20
      /* setup environment variable $repeat */
 -    sprintf(foo,"repeat=3D%ld",(long)repeats);
 +    snprintf(foo,LONG_CHARS+7+1,"repeat=3D%ld",(long)repeats);
      putenv(foo);
      foo+=3Dstrlen(foo)+1;
 =20
      /* setup environment variable $DISPLAY */
      if(displayname)
      {
 -      sprintf(foo,"DISPLAY=3D%s",displayname);
 +      snprintf(foo,strlen(displayname)+1+8,"DISPLAY=3D%s",displayname);
        D("putenv(%s)\n",foo);
        putenv(foo);
        foo+=3Dstrlen(foo)+1;
 @@ -526,7 +528,7 @@
      /* setup environment variable $mimetype */
      if(mimetype)
      {
 -      sprintf(foo,"mimetype=3D%s",mimetype);
 +      snprintf(foo,strlen(mimetype)+1+9,"mimetype=3D%s",mimetype);
        D("putenv(%s)\n",foo);
        putenv(foo);
        foo+=3Dstrlen(foo)+1;
 
 --=-piIMQ5GyQfnNxE6LyrJa--
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203250740.g2P7e3L61240>