Bug 22495 - Memory-Leak in UCR-C-Librarym u_c_r_set_string() kaputt
Summary: Memory-Leak in UCR-C-Librarym u_c_r_set_string() kaputt
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: UCR
Version: UCS 3.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 3.0 - MS2
Assignee: Philipp Hahn
QA Contact: Moritz Muehlenhoff
URL:
Keywords:
Depends on:
Blocks: 22160
  Show dependency treegraph
 
Reported: 2011-05-12 10:28 CEST by Philipp Hahn
Modified: 2011-12-13 15:51 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Fix UCS-C-Library (5.85 KB, patch)
2011-05-12 10:28 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2011-05-12 10:28:38 CEST
Created attachment 3261 [details]
Fix UCS-C-Library

Leaks:

univention_config_get_int():
s_var=(char*)strndup(&(line[strlen(value)+2]), strlen(line) - (strlen(value)+2)
- 1 );
-            return atoi(s_var);

univention_config_get_long():
-            s_var=(char*)strndup(&(line[strlen(value)+2]), strlen(line) -
(strlen(value)+2) - 1 );
-            return atol(s_var);

u_c_r_set_string() funktioniert nicht:
-        argv[2] = "univention-config-registry";
-        argv[2] = "set";

Patch:
!Fix memory leak
!Fix u_c_r_set_string()
+Dokumentation
Comment 1 Philipp Hahn univentionstaff 2011-05-18 13:17:44 CEST
Der Patch wurde in nochmals leicht überarbeiteter Form eingespielt.
In tests/clib.c befindet sich ein einfacher Test, um die Implementierung zu testen. Dafür muß allerdings u-c bereits installiert sein, weil die Pfade /u/sbin/ucr hart kodiert sind.

svn24261, univention-config-registry_7.0.7-1.334.201105181244

ChangeLog:
\item Several memory leaks and implementation details in the C-library have been fixed (\ucsBug{22495}).
Comment 2 Moritz Muehlenhoff univentionstaff 2011-09-26 16:51:25 CEST
Die Speicherfreigabe im Fehlerfall ist jetzt korrekt. Die Asserts im clib-Testprogramm werden mit der aktuellen Version nicht getriggert. 

Der Changelog-Eintrag aus Kommentar 1 fehlte im SVN, den habe ich aber selbst commitet.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2011-12-13 15:51:20 CET
UCS 3.0-0 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"