diff --git a/kismet-2006-04-R1-alias.patch b/kismet-2006-04-R1-alias.patch deleted file mode 100644 index 8313769..0000000 --- a/kismet-2006-04-R1-alias.patch +++ /dev/null @@ -1,221 +0,0 @@ -2006-04-22 Enrico Scholz - - * expat.cc, tcpclient.cc, gpsmap.cc, packetracker.cc: - - avoid constructs like - - | sscanf(..., "%u", (int *)&some_var); - - where 'some_var' is not an 'int'. Depending on the platform, - this might caused unwanted effects (e.g. assigning a 64-bit - 'int' to a 32-bit 'enum'; writing to unaligned addresses - causing kernel traps) - - Some time-handling related hunks should be reworked before - 2038 ;) - - ---- kismet-2006-04-R1/expat.cc.alias 2005-03-23 17:36:56.000000000 +0100 -+++ kismet-2006-04-R1/expat.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -192,12 +192,14 @@ int NetXmlStr2Struct(wireless_network *i - return -1; - } - -- if (sscanf(xmlstrnodes[net_node_wn_maxrate].c_str(), "%f", (float *) &in_net->maxrate) < 1) { -+ float tmpmaxrate; -+ if (sscanf(xmlstrnodes[net_node_wn_maxrate].c_str(), "%f", &tmpmaxrate) < 1) { - if (verbose) - fprintf(stderr, "WARNING: Illegal maxrate '%s', skipping rest of network.\n", - xmlstrnodes[net_node_wn_maxrate].c_str()); - return -1; - } -+ in_net->maxrate = tmpmaxrate; - - if (sscanf(xmlstrnodes[net_node_pk_LLC].c_str(), "%d", &in_net->llc_packets) < 1) { - if (verbose) ---- kismet-2006-04-R1/tcpclient.cc.alias 2005-10-17 15:52:47.000000000 +0200 -+++ kismet-2006-04-R1/tcpclient.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -277,6 +277,8 @@ int TcpClient::ParseData(char *in_data) - char bssid_str[18]; - mac_addr bssid; - int junkmajor, junkminor, junktiny; -+#warning FIXME: implement reading of time_t types -+ int tmptime; // HACK: should be some 64-bit type - - if (sscanf(in_data, "%64[^:]", header) < 1) { - return 0; -@@ -294,14 +295,15 @@ int TcpClient::ParseData(char *in_data) - if (sscanf(in_data+hdrlen, "%d.%d.%d %d \001%32[^\001]\001 %24s %d " - "%24[^.].%24[^.].%24s", - &junkmajor, &junkminor, &junktiny, -- (int *) &start_time, servername, -+ &tmptime, servername, - build, &channel_hop, - major, minor, tiny) < 7) - return 0; -+ start_time = tmptime; - } else if (!strncmp(header, "*TIME", 64)) { -- if (sscanf(in_data+hdrlen, "%d", (int *) &serv_time) < 1) -+ if (sscanf(in_data+hdrlen, "%d", &tmptime) < 1) - return 0; -- -+ serv_time = tmptime; - } else if (!strncmp(header, "*NETWORK", 64)) { - wireless_network *net; - -@@ -393,17 +395,23 @@ int TcpClient::ParseData(char *in_data) - newnet = 1; - } - -+ { -+ int tmptype, tmpatype; -+ int tmpturbocell_mode; -+#warning FIXME: implement reading of time_t types -+ int tmpfirst_time; // HACK: should be some 64-bit type -+ int tmplast_time; // HACK: should be some 64-bit type - scanned = sscanf(in_data+hdrlen+18, "%d \001%255[^\001]\001 " - "\001%255[^\001]\001 " - "%d %d %d %d %d %d %d %d %d %hd.%hd.%hd.%hd " - "%d %f %f %f %f %f %f %f %f %d %d %d %f %d %d %d %d %d %d " - "%f %f %f %lf %lf %lf %ld %ld" - "%d %d %d %d %d %d %d %d %lld", -- (int *) &type, ssid, beaconstr, -+ &tmptype, ssid, beaconstr, - &llc_packets, &data_packets, &crypt_packets, - &interesting_packets, &channel, &crypt_set, -- (int *) &first_time, (int *) &last_time, -- (int *) &atype, &range[0], &range[1], &range[2], -+ &tmpfirst_time, &tmplast_time, -+ &tmpatype, &range[0], &range[1], &range[2], - &range[3], &gps_fixed, &min_lat, &min_lon, - &min_alt, &min_spd, &max_lat, &max_lon, - &max_alt, &max_spd, &octets, -@@ -413,10 +420,16 @@ int TcpClient::ParseData(char *in_data) - &best_lat, &best_lon, &best_alt, - &aggregate_lat, &aggregate_lon, &aggregate_alt, - &aggregate_points, &datasize, -- &turbocell_nid, (int *) &turbocell_mode, -+ &turbocell_nid, &tmpturbocell_mode, - &turbocell_sat, &carrier_set, &maxseenrate, - &encoding_set, &decrypted, &dupeiv_packets, &bss_timestamp); -- -+ type = static_cast(tmptype); -+ first_time = tmpfirst_time; -+ last_time = tmplast_time; -+ atype = static_cast(tmpatype); -+ turbocell_mode = static_cast(tmpturbocell_mode); -+ } -+ - if (scanned < 51) { - // fprintf(stderr, "Flubbed network, discarding... %s '%s'\n", bssid_str, in_data); - // Can't delete us out of the tracker offhand if we're not a new network, -@@ -562,12 +575,17 @@ int TcpClient::ParseData(char *in_data) - return 0; - } - -+ { -+ int tmptype, tmpatype; -+#warning FIXME: implement reading of time_t types -+ int tmpfirst_time; // HACK: should be some 64-bit type -+ int tmplast_time; // HACK: should be some 64-bit type - scanned = sscanf(in_data+hdrlen+36, "%d %d %d %d %d %d %d " - "%f %f %f %f %f %f %f %f %lf %lf " - "%lf %ld %f %d %d %d %d %d %d " - "%f %f %f %d %hd.%hd.%hd.%hd %ld %d %d %d %d", -- (int *) &type, -- (int *) &first_time, (int *) &last_time, -+ &tmptype, -+ &tmpfirst_time, &tmplast_time, - &data_packets, &crypt_packets, - &interesting_packets, - &gps_fixed, &min_lat, &min_lon, -@@ -580,9 +597,14 @@ int TcpClient::ParseData(char *in_data) - &best_quality, &best_signal, - &best_noise, - &best_lat, &best_lon, &best_alt, -- (int *) &atype, &ip[0], &ip[1], &ip[2], &ip[3], -+ &tmpatype, &ip[0], &ip[1], &ip[2], &ip[3], - &datasize, &maxseenrate, &encoding_set, - &decrypted, &crypt_set); -+ type = static_cast(tmptype); -+ first_time = tmpfirst_time; -+ last_time = tmplast_time; -+ atype = static_cast(tmpatype); -+ } - - if (scanned < 39) { - if (nclient) -@@ -767,20 +789,31 @@ int TcpClient::ParseData(char *in_data) - short int sip[4], dip[4]; - int sport, dport; - -+ { -+ int tmptype, tmpsubtype, tmptvsec; -+ int tmpproto_type, tmpsport, tmpdport, tmpproto_nbtype; - if (sscanf(in_data+hdrlen, "%d %d %d %d %d %d %17s %17s %17s " - "\001%32[^\001]\001 %d %hd.%hd.%hd.%hd %hd.%hd.%hd.%hd %d %d %d " - "\001%16[^\001]\001\n", -- (int *) &packinfo.type, -- (int *) &packinfo.subtype, -- (int *) &packinfo.ts.tv_sec, -+ &tmptype, -+ &tmpsubtype, -+ &tmptvsec, - &packinfo.encrypted, &packinfo.interesting, &packinfo.beacon, - smac, dmac, bmac, - packinfo.ssid, -- (int *) &packinfo.proto.type, -+ &tmpproto_type, - &sip[0], &sip[1], &sip[2], &sip[3], &dip[0], &dip[1], &dip[2], &dip[3], -- (int *) &sport, (int *) &dport, -- (int *) &packinfo.proto.nbtype, packinfo.proto.netbios_source) < 22) -+ &tmpsport, &tmpdport, -+ &tmpproto_nbtype, packinfo.proto.netbios_source) < 22) - return 0; -+ packinfo.type = static_cast(tmptype); -+ packinfo.subtype = static_cast(tmpsubtype); -+ packinfo.ts.tv_sec = tmptvsec; -+ packinfo.proto.type = static_cast(tmpproto_type); -+ sport = tmpsport; -+ dport = tmpdport; -+ packinfo.proto.nbtype = static_cast(tmpproto_nbtype); -+ } - - packinfo.source_mac = smac; - packinfo.dest_mac = dmac; ---- kismet-2006-04-R1/gpsmap.cc.alias 2006-04-22 18:22:02.000000000 +0200 -+++ kismet-2006-04-R1/gpsmap.cc 2006-04-22 18:22:03.000000000 +0200 -@@ -2212,7 +2212,9 @@ void DrawNetPower(vector - // Now wait for the threads to complete and come back - int thread_status; - for (int t = 0; t < numthreads; t++) { -- pthread_join(mapthread[t], (void **) &thread_status); -+ void *tmp; -+ pthread_join(mapthread[t], &tmp); -+ thread_status = reinterpret_cast(tmp); - } - #else - // Run one instance of our "thread". thread number 0, it should just crunch it all ---- kismet-2006-04-R1/packetracker.cc.alias 2006-04-22 18:22:02.000000000 +0200 -+++ kismet-2006-04-R1/packetracker.cc 2006-04-22 18:22:03.000000000 +0200 -@@ -2350,6 +2350,7 @@ void Packetracker::ReadIPMap(FILE *in_fi - memset(&dat, 0, sizeof(net_ip_data)); - - short int range[4]; -+ int tmpatype; - /* - , mask[4], gate[4]; - */ -@@ -2357,10 +2358,11 @@ void Packetracker::ReadIPMap(FILE *in_fi - // Fetch the line and continue if we're invalid... - if (sscanf(dline, "%17s %d %d %hd %hd %hd %hd", - bssid_str, -- (int *) &dat.atype, &dat.octets, -+ &tmpatype, &dat.octets, - &range[0], &range[1], &range[2], &range[3] - ) < 7) - continue; -+ dat.atype = static_cast(tmpatype); - - for (int x = 0; x < 4; x++) { - dat.range_ip[x] = (uint8_t) range[x]; diff --git a/kismet-2006-04-R1-alias1.patch b/kismet-2006-04-R1-alias1.patch deleted file mode 100644 index b0915b5..0000000 --- a/kismet-2006-04-R1-alias1.patch +++ /dev/null @@ -1,40 +0,0 @@ -2006-04-29 Enrico Scholz - - * gpsmap.cc: fixed compilation errors on 64-bit platforms - which were created by my previous -alias patch. This patch - and the problems were reported by Hans de Goede at - - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=165314#c24 - - The value_ptr argument was ommited completely in the - pthread_join() call because the result will not be used - at all. - - Alternatively, - - | thread_status = reinterpret_cast(tmp); - - instead of - - | thread_status = reinterpret_cast(tmp); - - should be possible. - - -diff --git a/gpsmap.cc b/gpsmap.cc -index 1ce771b..915a482 100644 ---- a/gpsmap.cc -+++ b/gpsmap.cc -@@ -2210,11 +2210,8 @@ #ifdef HAVE_PTHREAD - pthread_attr_destroy(&attr); - - // Now wait for the threads to complete and come back -- int thread_status; - for (int t = 0; t < numthreads; t++) { -- void *tmp; -- pthread_join(mapthread[t], &tmp); -- thread_status = reinterpret_cast(tmp); -+ pthread_join(mapthread[t], NULL); - } - #else - // Run one instance of our "thread". thread number 0, it should just crunch it all diff --git a/kismet-2006-04-R1-noret.patch b/kismet-2006-04-R1-noret.patch deleted file mode 100644 index 855a5cd..0000000 --- a/kismet-2006-04-R1-noret.patch +++ /dev/null @@ -1,214 +0,0 @@ -2006-04-22 Enrico Scholz - - * prism2source.cc, util.cc, configfile.cc, pcapsource.cc, - manuf.cc, packetracker.cc, frontend.cc, panelfront.cc, - gpsmap.cc: - - honor the return value of a lot of syscall/libc functions - marked with __attribute__((__warn_result__)). - - Some/all of the 'fgets(...)==NULL || feof(...)' constructs - abort correctly on error but do not report the error. - - ---- kismet-2006-04-R1/prism2source.cc.noret 2004-08-12 03:59:50.000000000 +0200 -+++ kismet-2006-04-R1/prism2source.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -107,7 +107,8 @@ int Prism2Source::FetchPacket(kis_packet - - if (FD_ISSET(read_sock, &rs)) { - char a; -- read(read_sock, &a, 1); -+ if (read(read_sock, &a, 1)!=1) -+ return -1; - } - - // u_char buf[MAX_PACKET_LEN]; ---- kismet-2006-04-R1/util.cc.noret 2005-06-15 23:54:08.000000000 +0200 -+++ kismet-2006-04-R1/util.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -248,9 +248,7 @@ vector Str2IntVec(string in_text) { - } - - int RunSysCmd(char *in_cmd) { -- system(in_cmd); -- -- return 0; -+ return system(in_cmd); - } - - pid_t ExecSysCmd(char *in_cmd) { ---- kismet-2006-04-R1/configfile.cc.noret 2006-01-04 16:32:46.000000000 +0100 -+++ kismet-2006-04-R1/configfile.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -38,9 +38,8 @@ int ConfigFile::ParseConfig(const char * - } - - while (!feof(configf)) { -- fgets(confline, 8192, configf); -- -- if (feof(configf)) break; -+ if (fgets(confline, 8192, configf) == NULL || -+ feof(configf)) break; - - // It's easier to parse this using C++ functions - string parsestr = StrStrip(confline); ---- kismet-2006-04-R1/pcapsource.cc.noret 2006-04-02 17:13:00.000000000 +0200 -+++ kismet-2006-04-R1/pcapsource.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -2054,7 +2054,10 @@ int monitor_ipwlivetap(const char *in_de - return -1; - } - -- fgets(dynif, 32, sysf); -+ if (fgets(dynif, 32, sysf) == NULL) { -+ fclose(sysf); -+ return -1; -+ } - - // We're done with the RO - fclose(sysf); -@@ -2084,7 +2087,10 @@ int monitor_ipwlivetap(const char *in_de - return -1; - } - -- fgets(dynif, 32, sysf); -+ if (fgets(dynif, 32, sysf) == NULL) { -+ fclose(sysf); -+ return -1; -+ } - - fclose(sysf); - ---- kismet-2006-04-R1/manuf.cc.noret 2004-01-14 03:18:32.000000000 +0100 -+++ kismet-2006-04-R1/manuf.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -48,8 +48,8 @@ macmap > ReadManufMap(FI - // Read from the file - char dline[8192]; - while (!feof(in_file)) { -- fgets(dline, 8192, in_file); -- if (feof(in_file)) break; -+ if (fgets(dline, 8192, in_file) == NULL || -+ feof(in_file)) break; - - linenum++; - ---- kismet-2006-04-R1/packetracker.cc.noret 2006-04-01 18:37:07.000000000 +0200 -+++ kismet-2006-04-R1/packetracker.cc 2006-04-22 18:22:03.000000000 +0200 -@@ -2295,9 +2295,8 @@ void Packetracker::ReadSSIDMap(FILE *in_ - char bssid_str[18]; - - while (!feof(in_file)) { -- fgets(dline, 8192, in_file); -- -- if (feof(in_file)) break; -+ if (fgets(dline, 8192, in_file) == NULL || -+ feof(in_file)) break; - - if (sscanf(dline, "%17s %1023[^\n]\n", - bssid_str, name) < 2) -@@ -2313,8 +2312,10 @@ void Packetracker::ReadSSIDMap(FILE *in_ - } - - void Packetracker::WriteSSIDMap(FILE *in_file) { -- fseek(in_file, 0L, SEEK_SET); -- ftruncate(fileno(in_file), 0); -+ if (fseek(in_file, 0L, SEEK_SET) == -1 || -+ ftruncate(fileno(in_file), 0) == -1) -+ abort(); // HACK: implement better error-handling -+#warning FIXME: implement better error-handling - - char format[64]; - snprintf(format, 64, "%%.%ds %%.%ds\n", MAC_STR_LEN, SSID_SIZE); -@@ -2344,9 +2344,8 @@ void Packetracker::ReadIPMap(FILE *in_fi - net_ip_data dat; - - while (!feof(in_file)) { -- fgets(dline, 8192, in_file); -- -- if (feof(in_file)) break; -+ if (fgets(dline, 8192, in_file) == NULL || -+ feof(in_file)) break; - - memset(&dat, 0, sizeof(net_ip_data)); - -@@ -2382,8 +2383,10 @@ void Packetracker::ReadIPMap(FILE *in_fi - } - - void Packetracker::WriteIPMap(FILE *in_file) { -- fseek(in_file, 0L, SEEK_SET); -- ftruncate(fileno(in_file), 0); -+ if (fseek(in_file, 0L, SEEK_SET) == -1 || -+ ftruncate(fileno(in_file), 0) == -1) -+ abort(); // HACK: better error-handling -+#warning FIXME: implement better error-handling - - for (map::iterator x = bssid_ip_map.begin(); - x != bssid_ip_map.end(); ++x) { -@@ -2445,8 +2447,10 @@ void Packetracker::RemoveNetwork(mac_add - - // Write a gpsdrive compatable waypoint file - int Packetracker::WriteGpsdriveWaypt(FILE *in_file) { -- fseek(in_file, 0L, SEEK_SET); -- ftruncate(fileno(in_file), 0); -+ if (fseek(in_file, 0L, SEEK_SET) == -1 || -+ ftruncate(fileno(in_file), 0) == -1) -+ abort(); // HACK: better error-handling -+#warning FIXME: implement better error-handling - - // Convert the map to a vector and sort it - for (map::const_iterator i = bssid_map.begin(); ---- kismet-2006-04-R1/frontend.cc.noret 2005-06-29 20:04:43.000000000 +0200 -+++ kismet-2006-04-R1/frontend.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -722,9 +722,8 @@ void Frontend::ReadGroupMap(FILE *in_fil - snprintf(format, 64, "%%6[^:]: %%%d[^ ] %%1024[^\n]\n", MAC_STR_LEN); - - while (!feof(in_file)) { -- fgets(dline, 8192, in_file); -- -- if (feof(in_file)) break; -+ if (fgets(dline, 8192, in_file) == NULL || -+ feof(in_file)) break; - - // Fetch the line and continue if we're invalid... - if (sscanf(dline, format, type, parm1, parm2) < 3) ---- kismet-2006-04-R1/panelfront.cc.noret 2005-06-29 20:04:43.000000000 +0200 -+++ kismet-2006-04-R1/panelfront.cc 2006-04-22 18:22:02.000000000 +0200 -@@ -1398,16 +1398,14 @@ int PanelFront::Tick() { - int ac_line_status, battery_status, flag, percentage, apm_time; - char units[32]; - -- if ((apm = fopen("/proc/apm", "r")) == NULL) { -+ if ((apm = fopen("/proc/apm", "r")) == NULL || -+ fgets(buf, 128, apm) == NULL) { - bat_available = 0; - bat_ac = 0; - bat_percentage = 0; - bat_time = 0; - bat_charging = 0; - } else { -- fgets(buf, 128, apm); -- fclose(apm); -- - sscanf(buf, "%*s %*d.%*d %*x %x %x %x %d%% %d %s\n", &ac_line_status, - &battery_status, &flag, &percentage, &apm_time, units); - -@@ -1436,6 +1434,8 @@ int PanelFront::Tick() { - if (!strncmp(units, "min", 32)) - bat_time *= 60; - } -+ if (apm!=NULL) -+ fclose(apm); - } else { - DIR *batteries, *ac_adapters; - struct dirent *this_battery, *this_adapter; ---- kismet-2006-04-R1/gpsmap.cc.noret 2005-11-02 22:16:07.000000000 +0100 -+++ kismet-2006-04-R1/gpsmap.cc 2006-04-22 18:22:03.000000000 +0200 -@@ -4178,7 +4180,10 @@ int main(int argc, char *argv[]) { - } else { - char geturl[1024]; - snprintf(geturl, 1024, download_template, url, mapname); -- system(geturl); -+ if (system(geturl)!=0) { -+ fprintf(stderr, "WARNING: failed to execute '%s'\n", geturl); -+ exit(1); -+ } - } - - printf("Loading map into Imagemagick structures.\n"); diff --git a/kismet-2006-04-R1-packed.patch b/kismet-2006-04-R1-packed.patch deleted file mode 100644 index 1fd657c..0000000 --- a/kismet-2006-04-R1-packed.patch +++ /dev/null @@ -1,198 +0,0 @@ -2006-04-22 Enrico Scholz - - * packetstream.h, pcapsource.h, prism2source.h: placed compiler - attributes at the right place: - - | struct foo { - | char a __attribute__((packed)); - | int b __attribute__((packed)); - | }; - - is wrong, while - - | struct bar { - | char a; - | int b; - | } __attribute__((packed)); - - is right. This patch replaces 'packed' with '__packed__' too. - - ---- kismet-2006-04-R1/packetstream.h.packed 2005-05-26 16:51:45.000000000 +0200 -+++ kismet-2006-04-R1/packetstream.h 2006-04-22 18:22:02.000000000 +0200 -@@ -38,10 +38,10 @@ - #define STREAM_COMMAND_FLUSH -1 - - typedef struct stream_frame_header { -- uint32_t frame_sentinel __attribute__ ((packed)); -- uint8_t frame_type __attribute__ ((packed)); -- uint32_t frame_len __attribute__ ((packed)); --}; -+ uint32_t frame_sentinel; -+ uint8_t frame_type; -+ uint32_t frame_len; -+} __attribute__((__packed__)); - - typedef struct stream_version_packet { - uint16_t drone_version; -@@ -49,34 +49,34 @@ typedef struct stream_version_packet { - }; - - typedef struct stream_packet_header { -- uint32_t header_len __attribute__ ((packed)); -- uint16_t drone_version __attribute__ ((packed)); -- uint32_t len __attribute__ ((packed)); -- uint32_t caplen __attribute__ ((packed)); -- uint64_t tv_sec __attribute__ ((packed)); -- uint64_t tv_usec __attribute__ ((packed)); -- uint16_t quality __attribute__ ((packed)); -- uint16_t signal __attribute__ ((packed)); -- uint16_t noise __attribute__ ((packed)); -- uint8_t error __attribute__ ((packed)); -- uint8_t channel __attribute__ ((packed)); -- uint8_t carrier __attribute__ ((packed)); -- uint8_t encoding __attribute__ ((packed)); -- uint32_t datarate __attribute__ ((packed)); -- -- int16_t gps_lat __attribute__ ((packed)); -- int64_t gps_lat_mant __attribute__ ((packed)); -- int16_t gps_lon __attribute__ ((packed)); -- int64_t gps_lon_mant __attribute__ ((packed)); -- int16_t gps_alt __attribute__ ((packed)); -- int64_t gps_alt_mant __attribute__ ((packed)); -- int16_t gps_spd __attribute__ ((packed)); -- int64_t gps_spd_mant __attribute__ ((packed)); -- int16_t gps_heading __attribute__ ((packed)); -- int64_t gps_heading_mant __attribute__ ((packed)); -- int8_t gps_fix __attribute__ ((packed)); -+ uint32_t header_len; -+ uint16_t drone_version; -+ uint32_t len; -+ uint32_t caplen; -+ uint64_t tv_sec; -+ uint64_t tv_usec; -+ uint16_t quality; -+ uint16_t signal; -+ uint16_t noise; -+ uint8_t error; -+ uint8_t channel; -+ uint8_t carrier; -+ uint8_t encoding; -+ uint32_t datarate; -+ -+ int16_t gps_lat; -+ int64_t gps_lat_mant; -+ int16_t gps_lon; -+ int64_t gps_lon_mant; -+ int16_t gps_alt; -+ int64_t gps_alt_mant; -+ int16_t gps_spd; -+ int64_t gps_spd_mant; -+ int16_t gps_heading; -+ int64_t gps_heading_mant; -+ int8_t gps_fix; - -- uint8_t sourcename[32] __attribute__ ((packed)); --}; -+ uint8_t sourcename[32]; -+} __attribute__((__packed__)); - - #endif ---- kismet-2006-04-R1/pcapsource.h.packed 2006-03-29 05:08:05.000000000 +0200 -+++ kismet-2006-04-R1/pcapsource.h 2006-04-22 18:22:02.000000000 +0200 -@@ -91,27 +91,27 @@ protected: - // Prism 802.11 headers from wlan-ng tacked on to the beginning of a - // pcap packet... Snagged from the wlan-ng source - typedef struct { -- uint32_t did __attribute__ ((packed)); -- uint16_t status __attribute__ ((packed)); -- uint16_t len __attribute__ ((packed)); -- uint32_t data __attribute__ ((packed)); -- } p80211item_uint32_t; -+ uint32_t did; -+ uint16_t status; -+ uint16_t len; -+ uint32_t data; -+ } __attribute__((__packed__)) p80211item_uint32_t; - - typedef struct { -- uint32_t msgcode __attribute__ ((packed)); -- uint32_t msglen __attribute__ ((packed)); -- uint8_t devname[WLAN_DEVNAMELEN_MAX] __attribute__ ((packed)); -- p80211item_uint32_t hosttime __attribute__ ((packed)); -- p80211item_uint32_t mactime __attribute__ ((packed)); -- p80211item_uint32_t channel __attribute__ ((packed)); -- p80211item_uint32_t rssi __attribute__ ((packed)); -- p80211item_uint32_t sq __attribute__ ((packed)); -- p80211item_uint32_t signal __attribute__ ((packed)); -- p80211item_uint32_t noise __attribute__ ((packed)); -- p80211item_uint32_t rate __attribute__ ((packed)); -- p80211item_uint32_t istx __attribute__ ((packed)); -- p80211item_uint32_t frmlen __attribute__ ((packed)); -- } wlan_ng_prism2_header; -+ uint32_t msgcode; -+ uint32_t msglen; -+ uint8_t devname[WLAN_DEVNAMELEN_MAX]; -+ p80211item_uint32_t hosttime; -+ p80211item_uint32_t mactime; -+ p80211item_uint32_t channel; -+ p80211item_uint32_t rssi; -+ p80211item_uint32_t sq; -+ p80211item_uint32_t signal; -+ p80211item_uint32_t noise; -+ p80211item_uint32_t rate; -+ p80211item_uint32_t istx; -+ p80211item_uint32_t frmlen; -+ } __attribute__((__packed__)) wlan_ng_prism2_header; - - // Prism 802.11 headers from the openbsd Hermes drivers, even though they don't return - // a valid linktype yet. Structure lifted from bsd_airtools by dachb0den labs. ---- kismet-2006-04-R1/prism2source.h.packed 2004-08-09 06:36:01.000000000 +0200 -+++ kismet-2006-04-R1/prism2source.h 2006-04-22 18:22:02.000000000 +0200 -@@ -66,27 +66,27 @@ public: - - protected: - typedef struct { -- uint32_t did __attribute__ ((packed)); -- uint16_t status __attribute__ ((packed)); -- uint16_t len __attribute__ ((packed)); -- uint32_t data __attribute__ ((packed)); -- } p80211item_t; -+ uint32_t did; -+ uint16_t status; -+ uint16_t len; -+ uint32_t data; -+ } __attribute__((__packed__)) p80211item_t; - - typedef struct { -- uint32_t msgcode __attribute__ ((packed)); -- uint32_t msglen __attribute__ ((packed)); -- uint8_t devname[DEVNAME_LEN] __attribute__ ((packed)); -- p80211item_t hosttime __attribute__ ((packed)); -- p80211item_t mactime __attribute__ ((packed)); -- p80211item_t channel __attribute__ ((packed)); -- p80211item_t rssi __attribute__ ((packed)); -- p80211item_t sq __attribute__ ((packed)); -- p80211item_t signal __attribute__ ((packed)); -- p80211item_t noise __attribute__ ((packed)); -- p80211item_t rate __attribute__ ((packed)); -- p80211item_t istx __attribute__ ((packed)); -- p80211item_t frmlen __attribute__ ((packed)); -- } sniff_packet_t; -+ uint32_t msgcode; -+ uint32_t msglen; -+ uint8_t devname[DEVNAME_LEN]; -+ p80211item_t hosttime; -+ p80211item_t mactime; -+ p80211item_t channel; -+ p80211item_t rssi; -+ p80211item_t sq; -+ p80211item_t signal; -+ p80211item_t noise; -+ p80211item_t rate; -+ p80211item_t istx; -+ p80211item_t frmlen; -+ } __attribute__ ((__packed__)) sniff_packet_t; - - int Prism2Common(kis_packet *packet, uint8_t *data, uint8_t *moddata); - diff --git a/kismet-2006-04-R1-strop.patch b/kismet-2006-04-R1-strop.patch deleted file mode 100644 index f51bf0b..0000000 --- a/kismet-2006-04-R1-strop.patch +++ /dev/null @@ -1,430 +0,0 @@ -2006-04-22 Enrico Scholz - - * extra/buzzme/buzzme.c, libpcap-0.9.1-kis/fad-glifc.c, - libpcap-0.9.1-kis/pcap-nit.c, - libpcap-0.9.1-kis/pcap-snoop.c, - libpcap-0.9.1-kis/fad-gifc.c, - libpcap-0.9.1-kis/pcap-linux.c, - pcapsource.cc, tcpclient.cc, gpsmap_cache.cc, ifcontrol.cc: - - ensure, that strings copied by 'strncpy()' will be terminated - by '\0'. The following replacements are used for - - | strncpy(buf, 0, buf_len); - - a) when 'buf[buf_len-1] == '\0' can be guaranteed (e.g. by a - previous memset()): - | strncpy(buf, 0, buf_len - 1); - - b) when 'buf[buf_len-1] == '\0' can not be guaranteed: - - | strncpy(buf, 0, buf_len); - | buf[buf_len-1] = '\0'; - - on first glance it seems to be more efficient to use - - | strncpy(buf, 0, buf_len-1); - - But most 'buf_len' are multiples of 2 or 4 allowing the - compiler to generate more efficient code. - - At same places, - - | strncpy(buf, 0, sizeof buf); - - will be used where applicable. - - - Perhaps, it would be a good idea to use BSD's strlcpy() - there? - - * panelfront_display.cc - - most hunks fixes some oddnesses in the assignment/range-check - for 'print_width'. - - A range-check was added in PanelFront::StatsPrinter() which - was missing before. - - ---- kismet-2006-04-R1/extra/buzzme/buzzme.c.strop 2002-07-22 17:01:26.000000000 +0200 -+++ kismet-2006-04-R1/extra/buzzme/buzzme.c 2006-04-22 21:08:37.000000000 +0200 -@@ -94,6 +94,7 @@ main(int argc, char **argv) - - // Figure out program name. Remove path if needed. - strncpy(pname,argv[0],sizeof(pname)); -+ pname[sizeof(pname)-1] = '\0'; - if ((progname = rindex(pname,'/')) != NULL) { - progname++; // skip slash. - } ---- kismet-2006-04-R1/libpcap-0.9.1-kis/fad-glifc.c.strop 2005-06-21 02:58:08.000000000 +0200 -+++ kismet-2006-04-R1/libpcap-0.9.1-kis/fad-glifc.c 2006-04-22 21:08:37.000000000 +0200 -@@ -213,6 +213,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - */ - strncpy(ifrflags.lifr_name, ifrp->lifr_name, - sizeof(ifrflags.lifr_name)); -+ ifrflags.lifr_name[sizeof(ifrflags.lifr_name)-1] = '\0'; - if (ioctl(fd, SIOCGLIFFLAGS, (char *)&ifrflags) < 0) { - if (errno == ENXIO) - continue; -@@ -232,6 +233,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - */ - strncpy(ifrnetmask.lifr_name, ifrp->lifr_name, - sizeof(ifrnetmask.lifr_name)); -+ ifrnetmask.lifr_name[sizeof(ifrnetmask.lifr_name)-1] = '\0'; - memcpy(&ifrnetmask.lifr_addr, &ifrp->lifr_addr, - sizeof(ifrnetmask.lifr_addr)); - if (ioctl(fd, SIOCGLIFNETMASK, (char *)&ifrnetmask) < 0) { -@@ -259,6 +261,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - if (ifrflags.lifr_flags & IFF_BROADCAST) { - strncpy(ifrbroadaddr.lifr_name, ifrp->lifr_name, - sizeof(ifrbroadaddr.lifr_name)); -+ ifrbroadaddr.lifr_name[sizeof(ifrbroadaddr.lifr_name)-1] = '\0'; - memcpy(&ifrbroadaddr.lifr_addr, &ifrp->lifr_addr, - sizeof(ifrbroadaddr.lifr_addr)); - if (ioctl(fd, SIOCGLIFBRDADDR, -@@ -294,6 +297,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - if (ifrflags.lifr_flags & IFF_POINTOPOINT) { - strncpy(ifrdstaddr.lifr_name, ifrp->lifr_name, - sizeof(ifrdstaddr.lifr_name)); -+ ifrdstaddr.lifr_name[sizeof(ifrdstaddr.lifr_name)-1] = '\0'; - memcpy(&ifrdstaddr.lifr_addr, &ifrp->lifr_addr, - sizeof(ifrdstaddr.lifr_addr)); - if (ioctl(fd, SIOCGLIFDSTADDR, ---- kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-nit.c.strop 2005-06-21 02:58:08.000000000 +0200 -+++ kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-nit.c 2006-04-22 21:08:37.000000000 +0200 -@@ -199,7 +199,7 @@ pcap_inject_nit(pcap_t *p, const void *b - int ret; - - memset(&sa, 0, sizeof(sa)); -- strncpy(sa.sa_data, device, sizeof(sa.sa_data)); -+ strncpy(sa.sa_data, device, sizeof(sa.sa_data)-1); - ret = sendto(p->fd, buf, size, 0, &sa, sizeof(sa)); - if (ret == -1) { - snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send: %s", -@@ -273,8 +273,9 @@ pcap_open_live(const char *device, int s - "socket: %s", pcap_strerror(errno)); - goto bad; - } -+ memset(&snit, 0, sizeof snit); - snit.snit_family = AF_NIT; -- (void)strncpy(snit.snit_ifname, device, NITIFSIZ); -+ (void)strncpy(snit.snit_ifname, device, sizeof(snit.snit_ifname)-1); - - if (bind(fd, (struct sockaddr *)&snit, sizeof(snit))) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, ---- kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-snoop.c.strop 2005-06-21 02:58:08.000000000 +0200 -+++ kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-snoop.c 2006-04-22 21:08:37.000000000 +0200 -@@ -223,7 +223,7 @@ pcap_open_live(const char *device, int s - p->fd = fd; - memset(&sr, 0, sizeof(sr)); - sr.sr_family = AF_RAW; -- (void)strncpy(sr.sr_ifname, device, sizeof(sr.sr_ifname)); -+ (void)strncpy(sr.sr_ifname, device, sizeof(sr.sr_ifname)-1); - if (bind(fd, (struct sockaddr *)&sr, sizeof(sr))) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, "snoop bind: %s", - pcap_strerror(errno)); -@@ -316,6 +316,7 @@ pcap_open_live(const char *device, int s - * to be no greater than the MTU. - */ - (void)strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); -+ ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; - if (ioctl(fd, SIOCGIFMTU, (char *)&ifr) < 0) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, "SIOCGIFMTU: %s", - pcap_strerror(errno)); ---- kismet-2006-04-R1/libpcap-0.9.1-kis/fad-gifc.c.strop 2005-06-21 02:58:08.000000000 +0200 -+++ kismet-2006-04-R1/libpcap-0.9.1-kis/fad-gifc.c 2006-04-22 21:08:37.000000000 +0200 -@@ -188,6 +188,7 @@ scan_proc_net_dev(pcap_if_t **devlistp, - * it's not up. - */ - strncpy(ifrflags.ifr_name, name, sizeof(ifrflags.ifr_name)); -+ ifrflags.ifr_name[sizeof(ifrflags.ifr_name)-1] = '\0'; - if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifrflags) < 0) { - if (errno == ENXIO) - continue; -@@ -354,6 +355,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - */ - strncpy(ifrflags.ifr_name, ifrp->ifr_name, - sizeof(ifrflags.ifr_name)); -+ ifrflags.ifr_name[sizeof(ifrflags.ifr_name)-1] = '\0'; - if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifrflags) < 0) { - if (errno == ENXIO) - continue; -@@ -373,6 +375,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - */ - strncpy(ifrnetmask.ifr_name, ifrp->ifr_name, - sizeof(ifrnetmask.ifr_name)); -+ ifrnetmask.ifr_name[sizeof(ifrnetmask.ifr_name)-1] = '\0'; - memcpy(&ifrnetmask.ifr_addr, &ifrp->ifr_addr, - sizeof(ifrnetmask.ifr_addr)); - if (ioctl(fd, SIOCGIFNETMASK, (char *)&ifrnetmask) < 0) { -@@ -403,6 +406,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - if (ifrflags.ifr_flags & IFF_BROADCAST) { - strncpy(ifrbroadaddr.ifr_name, ifrp->ifr_name, - sizeof(ifrbroadaddr.ifr_name)); -+ ifrbroadaddr.ifr_name[sizeof(ifrbroadaddr.ifr_name)-1] = '\0'; - memcpy(&ifrbroadaddr.ifr_addr, &ifrp->ifr_addr, - sizeof(ifrbroadaddr.ifr_addr)); - if (ioctl(fd, SIOCGIFBRDADDR, -@@ -442,6 +446,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c - if (ifrflags.ifr_flags & IFF_POINTOPOINT) { - strncpy(ifrdstaddr.ifr_name, ifrp->ifr_name, - sizeof(ifrdstaddr.ifr_name)); -+ ifrdstaddr.ifr_name[sizeof(ifrdstaddr.ifr_name)-1] = '\0'; - memcpy(&ifrdstaddr.ifr_addr, &ifrp->ifr_addr, - sizeof(ifrdstaddr.ifr_addr)); - if (ioctl(fd, SIOCGIFDSTADDR, ---- kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-linux.c.strop 2005-07-19 22:06:52.000000000 +0200 -+++ kismet-2006-04-R1/libpcap-0.9.1-kis/pcap-linux.c 2006-04-22 21:08:37.000000000 +0200 -@@ -1496,7 +1496,7 @@ iface_get_id(int fd, const char *device, - struct ifreq ifr; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); - - if (ioctl(fd, SIOCGIFINDEX, &ifr) == -1) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, -@@ -1598,7 +1598,7 @@ static void pcap_close_linux( pcap_t *ha - * kernels. - */ - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, handle->md.device, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, handle->md.device, sizeof(ifr.ifr_name)-1); - if (ioctl(handle->fd, SIOCGIFFLAGS, &ifr) == -1) { - fprintf(stderr, - "Can't restore interface flags (SIOCGIFFLAGS failed: %s).\n" -@@ -1714,7 +1714,7 @@ live_open_old(pcap_t *handle, const char - - if (promisc) { - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); - if (ioctl(handle->fd, SIOCGIFFLAGS, &ifr) == -1) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, - "ioctl: %s", pcap_strerror(errno)); -@@ -1792,7 +1792,7 @@ iface_bind_old(int fd, const char *devic - socklen_t errlen = sizeof(err); - - memset(&saddr, 0, sizeof(saddr)); -- strncpy(saddr.sa_data, device, sizeof(saddr.sa_data)); -+ strncpy(saddr.sa_data, device, sizeof(saddr.sa_data)-1); - if (bind(fd, &saddr, sizeof(saddr)) == -1) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, - "bind: %s", pcap_strerror(errno)); -@@ -1831,7 +1831,7 @@ iface_get_mtu(int fd, const char *device - return BIGGER_THAN_ALL_MTUS; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); - - if (ioctl(fd, SIOCGIFMTU, &ifr) == -1) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, -@@ -1851,7 +1851,7 @@ iface_get_arptype(int fd, const char *de - struct ifreq ifr; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); - - if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) { - snprintf(ebuf, PCAP_ERRBUF_SIZE, ---- kismet-2006-04-R1/panelfront_display.cc.strop 2005-08-15 17:52:16.000000000 +0200 -+++ kismet-2006-04-R1/panelfront_display.cc 2006-04-22 21:08:37.000000000 +0200 -@@ -19,6 +19,7 @@ - #include "config.h" - - #include -+#include - - #include "panelfront.h" - #include "displaynetworksort.h" -@@ -1475,9 +1476,8 @@ int PanelFront::DetailsPrinter(void *in_ - char output[1024]; - kwin->text.clear(); - -- int print_width = kwin->print_width; -- if (print_width > 1024) -- print_width = 1023; -+ size_t const print_width = MIN(static_cast(kwin->print_width), -+ sizeof(output)); - - if (details_network == NULL) { - kwin->text.push_back("The network or group being displayed"); -@@ -1918,9 +1918,8 @@ int PanelFront::GpsPrinter(void *in_wind - - wireless_network *dnet = details_network->virtnet; - -- int print_width = kwin->print_width; -- if (print_width > 1024) -- print_width = 1023; -+ size_t const print_width = MIN(static_cast(kwin->print_width), -+ sizeof(output)); - - if (print_width < 32) { - kwin->text.push_back("Display not wide enough"); -@@ -2603,7 +2602,8 @@ int PanelFront::StatsPrinter(void *in_wi - vector details_text; - char output[1024]; - -- const int print_width = kwin->print_width; -+ const size_t print_width = MIN(static_cast(kwin->print_width), -+ sizeof(output)); - - snprintf(output, print_width, "Start : %.24s", ctime((const time_t *) &start_time)); - details_text.push_back(output); -@@ -2921,9 +2921,8 @@ int PanelFront::DetailsClientPrinter(voi - char temp[1024]; - kwin->text.clear(); - -- int print_width = kwin->print_width; -- if (print_width > 1024) -- print_width = 1023; -+ size_t const print_width = MIN(static_cast(kwin->print_width), -+ sizeof(output)); - - switch (details_client->type) { - case client_fromds: ---- kismet-2006-04-R1/pcapsource.cc.strop 2006-04-22 21:08:37.000000000 +0200 -+++ kismet-2006-04-R1/pcapsource.cc 2006-04-22 21:08:37.000000000 +0200 -@@ -2756,7 +2756,7 @@ bool RadiotapBSD::getmediaopt(int& optio - return false; - - memset(&ifmr, 0, sizeof(ifmr)); -- strncpy(ifmr.ifm_name, ifname.c_str(), sizeof(ifmr.ifm_name)); -+ strncpy(ifmr.ifm_name, ifname.c_str(), sizeof(ifmr.ifm_name)-1); - - /* - * We must go through the motions of reading all -@@ -2781,7 +2781,7 @@ bool RadiotapBSD::setmediaopt(int option - return false; - - memset(&ifmr, 0, sizeof(ifmr)); -- strncpy(ifmr.ifm_name, ifname.c_str(), sizeof(ifmr.ifm_name)); -+ strncpy(ifmr.ifm_name, ifname.c_str(), sizeof(ifmr.ifm_name)-1); - - /* - * We must go through the motions of reading all -@@ -2809,7 +2809,7 @@ bool RadiotapBSD::setmediaopt(int option - delete mwords; - - memset(&ifr, 0, sizeof(ifr)); -- strncpy(ifr.ifr_name, ifname.c_str(), sizeof(ifr.ifr_name)); -+ strncpy(ifr.ifr_name, ifname.c_str(), sizeof(ifr.ifr_name)-1); - ifr.ifr_media = (ifmr.ifm_current &~ IFM_OMASK) | options; - ifr.ifr_media = (ifr.ifr_media &~ IFM_MMASK) | IFM_MAKEMODE(mode); - -@@ -2863,7 +2863,7 @@ bool RadiotapBSD::get80211(int type, int - if (!checksocket()) - return false; - memset(&ireq, 0, sizeof(ireq)); -- strncpy(ireq.i_name, ifname.c_str(), sizeof(ireq.i_name)); -+ strncpy(ireq.i_name, ifname.c_str(), sizeof(ireq.i_name)-1); - ireq.i_type = type; - ireq.i_len = len; - ireq.i_data = data; -@@ -2881,7 +2881,7 @@ bool RadiotapBSD::set80211(int type, int - if (!checksocket()) - return false; - memset(&ireq, 0, sizeof(ireq)); -- strncpy(ireq.i_name, ifname.c_str(), sizeof(ireq.i_name)); -+ strncpy(ireq.i_name, ifname.c_str(), sizeof(ireq.i_name)-1); - ireq.i_type = type; - ireq.i_val = val; - ireq.i_len = len; -@@ -2898,6 +2898,7 @@ bool RadiotapBSD::getifflags(int& flags) - return false; - - strncpy(ifr.ifr_name, ifname.c_str(), sizeof (ifr.ifr_name)); -+ ifr.ifr_name[sizeof (ifr.ifr_name)-1] = '\0'; - if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { - perror("SIOCGIFFLAGS ioctl failed"); - return false; ---- kismet-2006-04-R1/tcpclient.cc.strop 2006-04-22 21:08:37.000000000 +0200 -+++ kismet-2006-04-R1/tcpclient.cc 2006-04-22 21:08:37.000000000 +0200 -@@ -107,6 +107,7 @@ int TcpClient::Connect(short int in_port - } - - strncpy(hostname, in_host, MAXHOSTNAMELEN); -+ hostname[MAXHOSTNAMELEN-1] = '\0'; - - // Set up our socket - //bzero(&client_sock, sizeof(client_sock)); ---- kismet-2006-04-R1/gpsmap_cache.cc.strop 2005-03-10 17:49:34.000000000 +0100 -+++ kismet-2006-04-R1/gpsmap_cache.cc 2006-04-22 21:08:37.000000000 +0200 -@@ -174,6 +174,8 @@ int ReadGpsCacheFile(const char *in_gpsf - - strncpy(pt->bssid, cpt.bssid, MAC_STR_LEN); - strncpy(pt->source, cpt.source, MAC_STR_LEN); -+ pt->bssid[MAC_STR_LEN-1] = '\0'; -+ pt->source[MAC_STR_LEN-1] = '\0'; - pt->tv_sec = cpt.tv_sec; - pt->tv_usec = cpt.tv_usec; - pt->lat = cpt.lat; -@@ -344,9 +346,10 @@ int WriteGpsCacheFile(const char *in_gps - for (unsigned int nsam = 0; nsam < fheader.num_points; nsam++) { - gpscache_point cpt; - gps_point *pt = (*in_points)[nsam]; -- -- strncpy(cpt.bssid, pt->bssid, MAC_STR_LEN); -- strncpy(cpt.source, pt->source, MAC_STR_LEN); -+ -+ memset(&cpt, 0, sizeof cpt); -+ strncpy(cpt.bssid, pt->bssid, sizeof(cpt.bssid)-1); -+ strncpy(cpt.source, pt->source, sizeof(cpt.source)-1); - cpt.tv_sec = pt->tv_sec; - cpt.tv_usec = pt->tv_usec; - cpt.lat = pt->lat; ---- kismet-2006-04-R1/ifcontrol.cc.strop 2004-08-09 06:36:01.000000000 +0200 -+++ kismet-2006-04-R1/ifcontrol.cc 2006-04-22 21:08:37.000000000 +0200 -@@ -32,7 +32,8 @@ int Ifconfig_Set_Flags(const char *in_de - } - - // Fetch interface flags -- strncpy(ifr.ifr_name, in_dev, IFNAMSIZ); -+ memset(&ifr, 0, sizeof ifr); -+ strncpy(ifr.ifr_name, in_dev, sizeof(ifr.ifr_name)-1); - ifr.ifr_flags = flags; - if (ioctl(skfd, SIOCSIFFLAGS, &ifr) < 0) { - snprintf(errstr, STATUS_MAX, "SetIFFlags: Unknown interface %s: %s", -@@ -58,7 +59,8 @@ int Ifconfig_Get_Flags(const char *in_de - } - - // Fetch interface flags -- strncpy(ifr.ifr_name, in_dev, IFNAMSIZ); -+ memset(&ifr, 0, sizeof ifr); -+ strncpy(ifr.ifr_name, in_dev, sizeof(ifr.ifr_name)-1); - if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) { - snprintf(errstr, STATUS_MAX, "GetIFFlags: interface %s: %s", - in_dev, strerror(errno)); -@@ -96,7 +98,8 @@ int Ifconfig_Get_Hwaddr(const char *in_d - } - - // Fetch interface flags -- strncpy(ifr.ifr_name, in_dev, IFNAMSIZ); -+ memset(&ifr, 0, sizeof ifr); -+ strncpy(ifr.ifr_name, in_dev, sizeof(ifr.ifr_name)-1); - if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0) { - snprintf(errstr, STATUS_MAX, "Getting HWAddr: unknown interface %s: %s", - in_dev, strerror(errno)); -@@ -122,7 +125,8 @@ int Ifconfig_Set_Hwaddr(const char *in_d - return -1; - } - -- strncpy(ifr.ifr_name, in_dev, IFNAMSIZ); -+ memset(&ifr, 0, sizeof ifr); -+ strncpy(ifr.ifr_name, in_dev, sizeof(ifr.ifr_name)-1); - memcpy(ifr.ifr_hwaddr.sa_data, in_hwaddr, 6); - ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; - -@@ -151,7 +155,8 @@ int Ifconfig_Set_MTU(const char *in_dev, - } - - // Fetch interface flags -- strncpy(ifr.ifr_name, in_dev, IFNAMSIZ); -+ memset(&ifr, 0, sizeof ifr); -+ strncpy(ifr.ifr_name, in_dev, sizeof(ifr.ifr_name)-1); - ifr.ifr_mtu = in_mtu; - if (ioctl(skfd, SIOCSIFMTU, &ifr) < 0) { - snprintf(errstr, STATUS_MAX, "Setting MTU: unknown interface %s: %s", diff --git a/kismet-2006-04-R1-uninit.patch b/kismet-2006-04-R1-uninit.patch deleted file mode 100644 index 783feed..0000000 --- a/kismet-2006-04-R1-uninit.patch +++ /dev/null @@ -1,15 +0,0 @@ -2006-04-22 Enrico Scholz - - * macaddr.h: initialized a 'second' attribute in an iterator - class which might be used uninitialized else - ---- kismet-2006-04-R1/macaddr.h.uninit 2006-01-04 16:32:46.000000000 +0100 -+++ kismet-2006-04-R1/macaddr.h 2006-04-22 18:22:02.000000000 +0200 -@@ -290,6 +290,7 @@ public: - } else { - singleton_itr = owner->singleton_map.end(); - vector_itr = owner->mask_vec.size(); -+ second = NULL; - } - } - diff --git a/kismet-2006-04-R1.tar.gz.asc b/kismet-2006-04-R1.tar.gz.asc deleted file mode 100644 index ea48483..0000000 --- a/kismet-2006-04-R1.tar.gz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.2.2 (GNU/Linux) - -iD8DBQBEPdlU17KIInOLvbERAhT2AKCWL5TA/FwgFZbFubgKQc8so8bYPACaAwQd -3W60uDYNJgwGoxNwroHB5t4= -=KeKF ------END PGP SIGNATURE-----