Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dev:underflow [2017/05/17 19:00] – created devadev:underflow [2017/05/17 19:03] (current) deva
Line 1: Line 1:
 +All the below calls to ''resize()'' use subtraction in the size calculation and might underflow because of the size being an unsigned int.
 +
 +To each, add a check to make sure that subtraction doesn't result in a negative value.
 +
 <code> <code>
-abouttab.cc:            text_edit.resize(width() - 2*margin, height() - 2*margin); +abouttab.cc:      text_edit.resize(width() - 2*margin, height() - 2*margin); 
-abouttab.cc:            text_edit.resize(width - 2*margin, height - 2*margin); +abouttab.cc:      text_edit.resize(width - 2*margin, height - 2*margin); 
-combobox.cc:            listbox.resize(width() - 10, 100); +combobox.cc:      listbox.resize(width() - 10, 100); 
-filebrowser.cc: lineedit.resize(width - 60 - brd, btn_h); +filebrowser.cc:   lineedit.resize(width - 60 - brd, btn_h); 
-filebrowser.cc: listbox.resize(width - 1 - 2*brd, height - btn_h - 2*brd - offset); +filebrowser.cc:   listbox.resize(width - 1 - 2*brd, height - btn_h - 2*brd - offset); 
-filebrowser.cc: btn_esc.resize((width - 1 - 2*brd) / 2 - brd / 2, btn_h); +filebrowser.cc:   btn_esc.resize((width - 1 - 2*brd) / 2 - brd / 2, btn_h); 
-filebrowser.cc: btn_sel.resize((width - 1 - 2*brd) / 2, btn_h); +filebrowser.cc:   btn_sel.resize((width - 1 - 2*brd) / 2, btn_h); 
-frame.cc:               content->resize(content_width, content_height); +listbox.cc:       basic.resize(width - (7 + 7), 
-layout.cc:                              item->resize(w, item_height); +listboxthin.cc:   basic.resize(width - (1 + 1), 
-layout.cc:                              item->resize(w, 0); +mainwindow.cc:    tabs.resize(width - 2 * 16, height); 
-layout.cc:                              item->resize(item_width, h); +tabwidget.cc:     stack.resize(width, height - bar_height); 
-layout.cc:                              item->resize(0, h); +textedit.cc:      scroll.resize(scroll.width(), height - 2*(y_border - 1));
-listbox.cc:     basic.resize(width - (7 + 7), +
-listboxthin.cc: basic.resize(width - (1 + 1), +
-mainwindow.cc:  tabs.resize(width - 2 * 16, height); +
-stackedwidget.cc:               currentWidget->resize(width(), height()); +
-stackedwidget.cc:               currentWidget->resize(width, height); +
-tabwidget.cc:           stack.resize(width, height - bar_height); +
-textedit.cc:            scroll.resize(scroll.width(), height - 2*(y_border - 1)); +
-window.cc:      native->resize(width, height);+
 </code> </code>
dev/underflow.1495040412.txt.gz · Last modified: 2017/05/17 19:00 by deva
Trace:
GNU Free Documentation License 1.3
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0