]> Kevux Git Server - fll/commitdiff
Cleanup: Add explicit buffer empty checks in owner and group funcctions.
authorKevin Day <kevin@kevux.org>
Sun, 5 Mar 2023 17:59:23 +0000 (11:59 -0600)
committerKevin Day <kevin@kevux.org>
Sun, 5 Mar 2023 17:59:23 +0000 (11:59 -0600)
level_3/fake/c/private-make.c
level_3/fake/c/private-make.h

index 642e986c3e14fa003c8baba375b8efea8740adaf..97740cc4051c105d07ec7f6d540529d2dead7288 100644 (file)
@@ -42,6 +42,12 @@ extern "C" {
 #ifndef _di_fake_make_get_id_group_
   f_status_t fake_make_get_id_group(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, gid_t *id) {
 
+    if (!buffer.used) {
+      fll_error_print(print, F_parameter, "fake_make_get_id_group", F_true);
+
+      return F_status_set_error(F_parameter);
+    }
+
     f_number_unsigned_t number = 0;
 
     f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number);
@@ -137,6 +143,12 @@ extern "C" {
 #ifndef _di_fake_make_get_id_owner_
   f_status_t fake_make_get_id_owner(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, uid_t *id) {
 
+    if (!buffer.used) {
+      fll_error_print(print, F_parameter, "fake_make_get_id_owner", F_true);
+
+      return F_status_set_error(F_parameter);
+    }
+
     f_number_unsigned_t number = 0;
 
     f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number);
index 365aae741ad307b2573fd3499516c55c5b680ac2..e7b2272e6073d15563c25347b881d23a5c6e9497 100644 (file)
@@ -110,6 +110,8 @@ extern "C" {
  *   The NULL terminated path to get the relative path of.
  *
  * @return
+ *   F_none on success.
+ *
  *   Status codes (with error bit) are returned on any problem.
  */
 #ifndef _di_fake_make_path_relative_