(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/sysinfo-get.c) |
| |
| 108 | | | const char *sysinfo_get(const char *mail_location) |
| 109 | | | { |
| 110 | | | const char *distro = "", *fs, *uname_info = ""; |
| 111 | | | #ifdef HAVE_SYS_UTSNAME_H |
| 112 | | | struct utsname u; |
| 113 | | | |
| 114 | | | if (uname(&u) < 0) |
Event 1:
uname() does not initialize u. - This may be because of a failure case or other special case for uname(). Consult the uname() documentation for more information.
hide
Event 2:
Taking true branch. uname(&u) < 0 evaluates to true.
hide
|
|
| 115 | | | i_error("uname() failed: %m"); |
| 116 | | | else { |
| 117 | | | uname_info = t_strdup_printf("%s %s %s", |
| 118 | | | u.sysname, u.release, u.machine); |
| 119 | | | } |
| 120 | | | if (strcmp(u.sysname, "Linux") == 0) |
Event 3:
u.sysname is passed to strcmp() as the first argument.
hide
Uninitialized Variable
*u.sysname was not initialized, but is used inside strcmp(). The issue can occur if the highlighted code executes. See related events 1 and 3. Show: All events | Only primary events |
|
| |