intl: Do not return NULL on asprintf failure in gettext [BZ #24018]

Message ID 875zvmq4o2.fsf@oldenburg2.str.redhat.com
State New
Headers show
Series
  • intl: Do not return NULL on asprintf failure in gettext [BZ #24018]
Related show

Commit Message

Florian Weimer Dec. 21, 2018, 3:29 p.m.
Fixes commit 9695dd0c9309712ed8e9c17a7040fe7af347f2dc ("DCIGETTEXT:
Use getcwd, asprintf to construct absolute pathname").

2018-12-21  Florian Weimer  <fweimer@redhat.com>

	[BZ #24018]
	* intl/dcigettext.c (DCIGETTEXT): Do not return NULL on asprintf
	failure.

Comments

Florian Weimer Jan. 2, 2019, 1:03 p.m. | #1
* Florian Weimer:

> Fixes commit 9695dd0c9309712ed8e9c17a7040fe7af347f2dc ("DCIGETTEXT:
> Use getcwd, asprintf to construct absolute pathname").
>
> 2018-12-21  Florian Weimer  <fweimer@redhat.com>
>
> 	[BZ #24018]
> 	* intl/dcigettext.c (DCIGETTEXT): Do not return NULL on asprintf
> 	failure.
>
> diff --git a/intl/dcigettext.c b/intl/dcigettext.c
> index 2a50369948..25f47c5bd3 100644
> --- a/intl/dcigettext.c
> +++ b/intl/dcigettext.c
> @@ -631,7 +631,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
>  	  int ret = __asprintf (&xdirname, "%s/%s", cwd, dirname);
>  	  free (cwd);
>  	  if (ret < 0)
> -	      return NULL;
> +	    goto return_untranslated;
>  	  dirname = xdirname;
>  	}
>  #ifndef IN_LIBGLOCALE

Siddhesh, is this still okay to apply during the freeze?

Thanks,
Florian
Siddhesh Poyarekar Jan. 2, 2019, 1:50 p.m. | #2
On 02/01/19 6:33 PM, Florian Weimer wrote:
> * Florian Weimer:
> 
>> Fixes commit 9695dd0c9309712ed8e9c17a7040fe7af347f2dc ("DCIGETTEXT:
>> Use getcwd, asprintf to construct absolute pathname").
>>
>> 2018-12-21  Florian Weimer  <fweimer@redhat.com>
>>
>> 	[BZ #24018]
>> 	* intl/dcigettext.c (DCIGETTEXT): Do not return NULL on asprintf
>> 	failure.
>>
>> diff --git a/intl/dcigettext.c b/intl/dcigettext.c
>> index 2a50369948..25f47c5bd3 100644
>> --- a/intl/dcigettext.c
>> +++ b/intl/dcigettext.c
>> @@ -631,7 +631,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
>>   	  int ret = __asprintf (&xdirname, "%s/%s", cwd, dirname);
>>   	  free (cwd);
>>   	  if (ret < 0)
>> -	      return NULL;
>> +	    goto return_untranslated;
>>   	  dirname = xdirname;
>>   	}
>>   #ifndef IN_LIBGLOCALE
> 
> Siddhesh, is this still okay to apply during the freeze?

OK.

Siddhesh

Patch

diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 2a50369948..25f47c5bd3 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -631,7 +631,7 @@  DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
 	  int ret = __asprintf (&xdirname, "%s/%s", cwd, dirname);
 	  free (cwd);
 	  if (ret < 0)
-	      return NULL;
+	    goto return_untranslated;
 	  dirname = xdirname;
 	}
 #ifndef IN_LIBGLOCALE