Hint Resolve cstring_valid_pointer : valid_pointer.
Definition cstringn {CS : compspecs} sh (s: list byte) n p :=
!!(~In Byte.zero s) &&
data_at sh (tarray tschar n) (map Vbyte (s ++ [Byte.zero]) ++
list_repeat (Z.to_nat (n - (Zlength s + 1))) Vundef) p.

Lemma cstringn_local_facts: forall {CS : compspecs} sh s n p,
cstringn sh s n p |-- !! (isptr p /\ Zlength s + 1 <= n <= Ptrofs.max_unsigned).