pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: printing with firefox3?
Apologies, this patch corrects an obvious error in the previous one.
Fortunately it still seems to work.
Yorick Hardy wrote:
This patch for CUPS also seems to work.
Would you be interested in taking a look?
--
Kind regards,
Yorick Hardy
--- cups/http.c.orig 2008-08-01 20:33:16.000000000 +0200
+++ cups/http.c 2009-01-29 10:37:48.000000000 +0200
@@ -1124,7 +1124,7 @@
struct timeval curtime; /* Current time in microseconds */
# endif /* !WIN32 */
int i; /* Looping var */
- unsigned char data[1024]; /* Seed data */
+ unsigned char *data; /* Seed data */
#endif /* HAVE_LIBSSL */
#ifdef WIN32
@@ -1172,10 +1172,17 @@
srand(curtime.tv_sec + curtime.tv_usec);
#endif /* WIN32 */
- for (i = 0; i < sizeof(data); i ++)
- data[i] = rand(); /* Yes, this is a poor source of random data... */
+ data = (unsigned char*) malloc(1024 * sizeof(unsigned char));
- RAND_seed(&data, sizeof(data));
+ if (data != NULL)
+ {
+ for (i = 0; i < 1024; i ++)
+ data[i] = rand(); /* Yes, this is a poor source of random data... */
+
+ RAND_seed(data, 1024 * sizeof(unsigned char));
+
+ free(data);
+ }
#endif /* HAVE_LIBSSL */
}
Home |
Main Index |
Thread Index |
Old Index