Commit 830ddb77 authored by robertdavidgraham's avatar robertdavidgraham
Browse files

static analysis warnings

parent 10fbd103
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -233,19 +233,6 @@ transmit_thread(void *v) /*aka. scanning_thread() */

    LOG(1, "xmit: starting transmit thread #%u\n", parms->nic_index);

    /* Lock this thread to a CPU. Transmit threads are on even CPUs,
     * receive threads on odd CPUs */
    if (pixie_cpu_get_count() > 1) {
        unsigned cpu_count = pixie_cpu_get_count();
        unsigned cpu = parms->nic_index * 2;
        while (cpu >= cpu_count) {
            cpu -= cpu_count;
            cpu++;
        }
        pixie_cpu_set_affinity(cpu);
        //pixie_cpu_raise_priority();
    }


    /* Create the shuffler/randomizer. This creates the 'range' variable,
     * which is simply the number of IP addresses times the number of
+2 −2
Original line number Diff line number Diff line
@@ -290,11 +290,11 @@ int banner1_selftest()
                    px+i, 1,
                    banner, &banner_offset, sizeof(banner)
                    );
    banner1_destroy(b);
    if (memcmp(banner, "Via:HTTP/1.1", 11) != 0) {
        printf("banner1: test failed\n");
        return 1;
    }
    banner1_destroy(b);

    /*
     * Test whole buffer
@@ -311,11 +311,11 @@ int banner1_selftest()
                    px, length,
                    banner, &banner_offset, sizeof(banner)
                    );
    banner1_destroy(b);
    if (memcmp(banner, "Via:HTTP/1.1", 11) != 0) {
        printf("banner1: test failed\n");
        return 1;
    }
    banner1_destroy(b);


    return 0;
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
#define PROTO_HTTP_H
#include "proto-banner1.h"

struct Banner1Stream banner_http;
extern struct Banner1Stream banner_http;

#endif
+1 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ snmp_banner(const unsigned char *oid, size_t oid_length,
            uint64_t result = 0;
            for (i=0; i<var_length; i++)
                result = result<<8 | var[i];
            sprintf_s(foo, sizeof(foo), "%llu", (unsigned long long)foo);
            sprintf_s(foo, sizeof(foo), "%llu", (unsigned long long)(size_t)foo);
            if (*banner_offset + strlen(foo) < banner_max) {
                memcpy(banner + *banner_offset, foo, strlen(foo));
                *banner_offset += (unsigned)strlen(foo);
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "packet-queue.h"
#include "proto-banner1.h"
#include "proto-ssl.h"
#include "proto-http.h"
#include "output.h"
#include "string_s.h"

@@ -651,8 +652,8 @@ tcpcon_handle(struct TCP_ConnectionTable *tcpcon, struct TCP_Control_Block *tcb,
            const unsigned char *x;
            switch (tcb->port_them) {
            case 80: 
                x = (const unsigned char *)banner_ssl.hello;
                x_len = banner_ssl.hello_length;
                x = (const unsigned char *)banner_http.hello;
                x_len = banner_http.hello_length;
                break;
            case 443:   /* HTTP/s */
            case 465:   /* SMTP/s */
Loading