trying to work out some problem points
Posted Dec 7, 2011 11:46 UTC (Wed) by
johill (subscriber, #25196)
In reply to:
trying to work out some problem points by khim
Parent article:
Fedora security update to nginx
I'm quite fluent in C, but still the code is puzzling. You're confusing "fluent in C" and "fluent in DNS" and assuming that everybody who reads that code must understand the DNS protocol with all its bits in its entirety, and completely know what each bit means.
Take an example from a different domain, and consider this code I'm writing just now:
switch (mgmt->u.action.category) {
case WLAN_CATEGORY_HT:
...
/* verify action & smps_control are present */
if (len < IEEE80211_MIN_ACTION_SIZE + 2)
goto invalid;
switch (mgmt->u.action.u.ht_smps.action) {
case WLAN_HT_ACTION_SMPS: {
It seems like you're suggesting it is equivalent to:
switch (*(frame + 24)) {
case 7:
...
if (len < 27)
goto invalid;
switch (*(frame + 25)) {
case 1: {
which is true on a binary/compiler level (there's a good chance it would compile to the same binary unless I made some small errors in my manual replacement), but not for people.
(
Log in to post comments)