Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 165252 Details for
Bug 237454
OpenVAS-Client v1.0.4 has a divison by zero bug
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that fixes division by zero bug
monitor_dialog.patch (text/plain), 1.53 KB, created by
adam
on 2008-09-12 09:18:44 UTC
(
hide
)
Description:
Patch that fixes division by zero bug
Filename:
MIME Type:
Creator:
adam
Created:
2008-09-12 09:18:44 UTC
Size:
1.53 KB
patch
obsolete
>--- monitor_dialog.c 2008-09-10 17:22:09.000000000 +0100 >+++ monitor_dialog2.c 2008-09-11 09:45:13.000000000 +0100 >@@ -347,7 +347,7 @@ > int flag = 0; > static harglst * hosts = NULL; > int v = 1; >- int newmax=0; >+ > if(!hosts) > { > hosts = harg_create(65000); >@@ -376,14 +376,14 @@ > if (GTK_CHECK_VERSION(2,6,0)) { /* TreeView since GTK 2.6 */ > GtkListStore * store = arg_get_value(ctrls, "MON_STORE"); > GtkTreeIter iter; >- if (max==0){ >- newmax=1; >- }else{ >- newmax=max; >+ int f; >+ if (max == 0) { >+ f = 100; >+ } else { >+ f = (atoi(current) / max) * 100; >+ if(f>=100)f=100; >+ if(f<=0)f=0; > } >- int f = (atoi(current) * 100) / newmax; >- if(f>=100)f=100; >- if(f<=0)f=0; > > if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { > do { >@@ -420,16 +420,21 @@ > GtkWidget * progress_bar; > gfloat f; > >+ gmax = max; >+ if (gmax == 0) { >+ f = 1.0; >+ } else { >+ gcurrent = atoi(current); >+ f = (gcurrent/gmax); >+ if(f>=1.0)f=1.0; >+ if(f<=0.0)f=0.0; >+ } >+ > if( strcmp(action, "portscan") == 0 ) > progress_bar = gtk_object_get_data(item, "progress_bar_portscan"); > else > progress_bar = gtk_object_get_data(item, "progress_bar_attack"); > >- gmax = max; >- gcurrent = atoi(current); >- f = (gcurrent/gmax); >- if(f>=1.0)f=1.0; >- if(f<=0.0)f=0.0; > gtk_progress_bar_update (GTK_PROGRESS_BAR(progress_bar), f); > > flag = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 237454
: 165252