@@ -3065,14 +3065,9 @@ def _do_get_name(self) -> str:
3065
3065
else :
3066
3066
raise AttributeError ("Unsupported kernel_symbol type implementation" )
3067
3067
3068
- layer = self ._context .layers [self .vol .layer_name ]
3069
- name_bytes = layer .read (name_offset , linux_constants .KSYM_NAME_LEN )
3070
-
3071
- idx = name_bytes .find (b"\x00 " )
3072
- if idx != - 1 :
3073
- name_bytes = name_bytes [:idx ]
3074
-
3075
- return name_bytes .decode ("utf-8" , errors = "ignore" )
3068
+ return utility .pointer_to_string (
3069
+ name_offset , linux_constants .KSYM_NAME_LEN , errors = "ignore"
3070
+ )
3076
3071
3077
3072
def get_name (self ) -> Optional [str ]:
3078
3073
try :
@@ -3108,14 +3103,9 @@ def _do_get_namespace(self) -> str:
3108
3103
else :
3109
3104
raise AttributeError ("Unsupported kernel_symbol type implementation" )
3110
3105
3111
- layer = self ._context .layers [self .vol .layer_name ]
3112
- namespace_bytes = layer .read (namespace_offset , linux_constants .KSYM_NAME_LEN )
3113
-
3114
- idx = namespace_bytes .find (b"\x00 " )
3115
- if idx != - 1 :
3116
- namespace_bytes = namespace_bytes [:idx ]
3117
-
3118
- return namespace_bytes .decode ("utf-8" , errors = "ignore" )
3106
+ return utility .pointer_to_string (
3107
+ namespace_offset , linux_constants .KSYM_NAME_LEN , errors = "ignore"
3108
+ )
3119
3109
3120
3110
def get_namespace (self ) -> Optional [str ]:
3121
3111
try :
0 commit comments