Projects
openEuler:24.03:SP1:Everything
json-c
_service:tar_scm:backport-Handle-yet-another-ou...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-Handle-yet-another-out-of-memory-condition.patch of Package json-c
From 833233faa8d6835276ebbd48b92c7feeb141270d Mon Sep 17 00:00:00 2001 From: Bruno Haible <bruno@clisp.org> Date: Mon, 22 Apr 2024 01:50:59 +0200 Subject: [PATCH] Handle yet another out-of-memory condition. duplocale() can return NULL, with errno set to ENOMEM. In this case, bail out and set the current error code to json_tokener_error_memory. --- json_tokener.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/json_tokener.c b/json_tokener.c index cc35527..0a86d82 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -341,6 +341,11 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char * #ifdef HAVE_USELOCALE { locale_t duploc = duplocale(oldlocale); + if (duploc == NULL && errno == ENOMEM) + { + tok->err = json_tokener_error_memory; + return NULL; + } newloc = newlocale(LC_NUMERIC_MASK, "C", duploc); if (newloc == NULL) { -- 2.43.4
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2