INN commit: trunk (3 files)

INN Commit rra at isc.org
Sun May 17 17:23:08 UTC 2015


    Date: Sunday, May 17, 2015 @ 10:23:07
  Author: iulius
Revision: 9870

Fixed alignment issues when storing values

Modified:
  trunk/nnrpd/sasl.c
  trunk/storage/timecaf/timecaf.c
  trunk/storage/timehash/timehash.c

-----------------------------+
 nnrpd/sasl.c                |    4 +++-
 storage/timecaf/timecaf.c   |    5 +++--
 storage/timehash/timehash.c |    5 +++--
 3 files changed, 9 insertions(+), 5 deletions(-)

Modified: nnrpd/sasl.c
===================================================================
--- nnrpd/sasl.c	2015-05-14 13:49:56 UTC (rev 9869)
+++ nnrpd/sasl.c	2015-05-17 17:23:07 UTC (rev 9870)
@@ -115,6 +115,7 @@
     const char *mech;
     const char *clientin = NULL;
     unsigned int clientinlen = 0;
+    size_t tclientinlen = 0;
     const char *serverout = NULL;
     unsigned int serveroutlen;
     char base64[BASE64_BUF_SIZE+1];
@@ -209,7 +210,8 @@
 
 	/* Get the response from the client. */
 	r1 = line_read(&NNTPline, PERMaccessconf->clienttimeout,
-		      &clientin, (size_t *) &clientinlen, NULL);
+		      &clientin, &tclientinlen, NULL);
+        clientinlen = tclientinlen;
         
         switch (r1) {
 	case RTok:

Modified: storage/timecaf/timecaf.c
===================================================================
--- storage/timecaf/timecaf.c	2015-05-14 13:49:56 UTC (rev 9869)
+++ storage/timecaf/timecaf.c	2015-05-17 17:23:07 UTC (rev 9870)
@@ -186,15 +186,16 @@
 
 static TOKEN *PathNumToToken(char *path, ARTNUM artnum) {
     int			n;
-    unsigned int        t1, t2;
+    unsigned int        tclass, t1, t2;
     STORAGECLASS        class;
     time_t              timestamp;
     static TOKEN	token;
 
-    n = sscanf(path, "timecaf-%02x/%02x/%04x.CF", (unsigned int *)&class, &t1, &t2);
+    n = sscanf(path, "timecaf-%02x/%02x/%04x.CF", &tclass, &t1, &t2);
     if (n != 3)
 	return (TOKEN *)NULL;
     timestamp = ((t1 << 8) & 0xff00) | ((t2 << 8) & 0xff0000) | ((t2 << 0) & 0xff);
+    class = tclass;
     token = MakeToken(timestamp, artnum, class, (TOKEN *)NULL);
     return &token;
 }

Modified: storage/timehash/timehash.c
===================================================================
--- storage/timehash/timehash.c	2015-05-14 13:49:56 UTC (rev 9869)
+++ storage/timehash/timehash.c	2015-05-17 17:23:07 UTC (rev 9870)
@@ -114,16 +114,17 @@
 
 static TOKEN *PathToToken(char *path) {
     int			n;
-    unsigned int        t1, t2, t3, seqnum;
+    unsigned int        tclass, t1, t2, t3, seqnum;
     STORAGECLASS        class;
     time_t		now;
     static TOKEN	token;
 
     n = sscanf(path, "time-%02x/%02x/%02x/%04x-%04x",
-               (unsigned int *)&class, &t1, &t2, &seqnum, &t3);
+               &tclass, &t1, &t2, &seqnum, &t3);
     if (n != 5)
 	return (TOKEN *)NULL;
     now = ((t1 << 16) & 0xff0000) | ((t2 << 8) & 0xff00) | ((t3 << 16) & 0xff000000) | (t3 & 0xff);
+    class = tclass;
     token = MakeToken(now, seqnum, class, (TOKEN *)NULL);
     return &token;
 }



More information about the inn-committers mailing list