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

bbtest-net crash: 4.2 RC with (fixed) all-in-one patch



I'm a new subscriber, been busy reading the archives.

First off... I don't think I saw this patch go through which fixes a problem exposed by the all-in-one patch:

*** hobbitd/hobbitd_alert.c.old Fri Aug  4 17:55:04 2006
--- hobbitd/hobbitd_alert.c     Fri Aug  4 17:55:16 2006
***************
*** 395,401 ****
                        namelist_t *hinfo;
                        int testdur = 0;
                        FILE *logfd = NULL;
!                       activealerts_t *awalk = NULL;;
                        int paramno = 0;

                        argi++; if (argi < argc) testhost = argv[argi];
--- 395,401 ----
                        namelist_t *hinfo;
                        int testdur = 0;
                        FILE *logfd = NULL;
!                       activealerts_t *awalk = NULL;
                        int paramno = 0;

                        argi++; if (argi < argc) testhost = argv[argi];




I also found an off by one error in bbtest-net.c:

*** bbnet/bbtest-net.c.old      Mon Aug  7 12:06:27 2006
--- bbnet/bbtest-net.c  Mon Aug  7 12:07:28 2006
***************
*** 1144,1150 ****
        }
        else {
                /* parent */
!               char ip[IP_ADDR_STRLEN];

                close(pfd[0]);
                pingcount = 0;
--- 1144,1150 ----
        }
        else {
                /* parent */
!               char ip[IP_ADDR_STRLEN+1];

                close(pfd[0]);
                pingcount = 0;


IP_ADDR_STRLEN is defined to be 16, but in start_ping_service, it's being used:


sprintf(ip, "%s\n", ip_to_test(t->host));

123.456.789.012 + \n + \0 is 17 characters. Whenever I had a "full" IP address configured, bbtest-net would crash and burn.

The very simple patch above seems to have done the trick :)