|
Bugzilla – Full Text Bug Listing |
| Summary: | Off-by-one in disable_execute | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Jüri Aedla <asd> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | low | ||
| Version: | 1.8.3 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Yes, you are correct. I've fixes this in the sudo source repo and the fix will be in sudo 1.8.4. Fixed in sudo 1.8.4. |
Hi, I think I see a possibility of writing outside of array bounds in sudo.c:disable_execute. The code looks like: for (ev = details->envp; *ev != NULL; ev++) { if (env_len + 2 > env_size) { env_size += 128; nenvp = erealloc3(nenvp, env_size, sizeof(char *)); } /* some code removed */ nenvp[env_len++] = *ev; } /* some code removed */ nenvp[env_len++] = cp; nenvp[env_len] = NULL; There is a possibility that env_len + 2 == env_size, so array is not increased and three elements get added.