[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1078371: Type missmatch, does not work on all architectures



Control: tags -1 + patch

This patch seem to solve the issue.  It also solve a similar issue with
the next qsort() call, which happen to not crash as there is less
validation of the char* content being compared.

--- nslint-salsa.orig/nslint.c	2024-08-13 11:40:01.746543401 +0200
+++ nslint-salsa/nslint.c	2024-08-13 11:40:18.746731846 +0200
@@ -629,8 +629,8 @@
 {
 	struct item *i1, *i2;
 
-	i1 = (struct item *)arg1;
-	i2 = (struct item *)arg2;
+	i1 = *(struct item **)arg1;
+	i2 = *(struct item **)arg2;
 
 	return (cmpaddr(&i1->addr, &i2->addr));
 }
@@ -640,8 +640,8 @@
 {
 	struct item *i1, *i2;
 
-	i1 = (struct item *)arg1;
-	i2 = (struct item *)arg2;
+	i1 = *(struct item **)arg1;
+	i2 = *(struct item **)arg2;
 
 	return (strcasecmp(i1->host, i1->host));
 }
@@ -1740,7 +1740,7 @@
 
 	/* Check for doubly booked addresses */
 	n = ipp - itemlist;
-	qsort(itemlist, n, sizeof(itemlist[0]), cmpaddr);
+	qsort(itemlist, n, sizeof(itemlist[0]), cmpitemaddr);
 	memset(&lastaddr, 0, sizeof(lastaddr));
 	ip = NULL;
 	for (ipp = itemlist; n > 0; ++ipp, --n) {

-- 
Happy hacking
Petter Reinholdtsen


Reply to: