On 09/23/2016 04:55 PM, william.c.robe...@intel.com wrote:
> From: William Roberts <william.c.robe...@intel.com>
> 
> Fix this:
> genusers.c:63:14: warning: variable 'nread' is uninitialized when used here 
> [-Wuninitialized]
>                 if (buffer[nread - 1] == '\n')
>                            ^~~~~
> genusers.c:40:15: note: initialize the variable 'nread' to silence this 
> warning
>         ssize_t nread;
>                      ^
>                       = 0
> 
> Signed-off-by: William Roberts <william.c.robe...@intel.com>

Thanks, applied all 3 patches.
NB none of this code is actually used on the Mac or elsewhere in Android
for that matter, and even on Linux, it is just legacy code (not used in
modern distributions).

> ---
>  libsepol/src/genusers.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libsepol/src/genusers.c b/libsepol/src/genusers.c
> index 57a9a2e..5568210 100644
> --- a/libsepol/src/genusers.c
> +++ b/libsepol/src/genusers.c
> @@ -53,6 +53,7 @@ static int load_users(struct policydb *policydb, const char 
> *path)
>       }
>  
>       while(fgets(buffer, 255, fp) != NULL) {
> +             nread = strlen(buffer);
>  #else
>       size_t len = 0;
>       __fsetlocking(fp, FSETLOCKING_BYCALLER);
> 

_______________________________________________
Selinux mailing list
Selinux@tycho.nsa.gov
To unsubscribe, send email to selinux-le...@tycho.nsa.gov.
To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Reply via email to