]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: fix generate-sym-test using the wrong array
authorFederico Giovanardi <federico.giovanardi@cnhind.com>
Fri, 15 Nov 2024 15:55:24 +0000 (16:55 +0100)
committerFederico Giovanardi <federico.giovanardi@cnhind.com>
Fri, 15 Nov 2024 16:12:42 +0000 (17:12 +0100)
The second check was searching the symbols into the same array, but
using the size of the other. This generated a SIGSEV when they
occassionally mismatched.

src/test/generate-sym-test.py

index 028d108bb5e6e6a8e510b93497434992cfe32795..914120b0bcaba39d73d1609f41ca55173511ece3 100755 (executable)
@@ -105,9 +105,9 @@ int main(void) {
         }
 
         for (j = 0; symbols_from_source[j].name; j++) {
-                struct symbol*n = bsearch(symbols_from_source+j, symbols_from_source, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
+                struct symbol*n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
                 if (!n)
-                        printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[i].name);
+                        printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[j].name);
         }
 
         return i == j ? EXIT_SUCCESS : EXIT_FAILURE;