This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[review v6] localedef: Add verbose messages for failure paths.


Carlos O'Donell has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/303
......................................................................


Patch Set 6:

(1 comment)

I fixed the buffer-overflow I introduced in the refactor in patchset 5. Only valgrind catches it, but I added a new tests-container test to verify the normalization of codesets is as expected and that has 9 new sub-tests for that verification.

Adhemerval, Would you mind having another look?

| --- locale/programs/localedef.c
| +++ locale/programs/localedef.c
| @@ -503,17 +503,11 @@ construct_output_path (char *path)
|  	{
|  	  /* We found a codeset specification.  Now find the end.  */
|  	  endp = ++startp;
| +
| +	  /* Stop at the first '@', and don't normalize anything past that.  */
|  	  while (*endp != '\0' && *endp != '@')
|  	    ++endp;
|  
|  	  if (endp > startp)
|  	    normal = normalize_codeset (startp, endp - startp);

PS5, Line 512:

There is a bug here I need to fix. If we normalize, then the string
length is potentially shorter or longer.

|  	}
| -      else
| -	/* This is to keep gcc quiet.  */
| -	endp = NULL;
| -
| -      /* We put an additional '\0' at the end of the string because at
| -	 the end of the function we need another byte for the trailing
| -	 '/'.  */
| -      ssize_t n;

-- 
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: I28b9f680711ff00252a2cb15625b774cc58ecb9d
Gerrit-Change-Number: 303
Gerrit-PatchSet: 6
Gerrit-Owner: Carlos O'Donell <carlos@redhat.com>
Gerrit-Reviewer: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-Reviewer: Carlos O'Donell <carlos@redhat.com>
Gerrit-Reviewer: Florian Weimer <fweimer@redhat.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Thu, 19 Dec 2019 04:37:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]