Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/2961/1/src/pseudotalloc/pseudotalloc.c
File src/pseudotalloc/pseudotalloc.c:

Line 72:        while (1) {
since this is for an embedded libosmocore, it doesn't make sense to allow any 
size of string. I would use a smaller len (64? 128?) and simply not enlarge, 
being fine with truncated strings. (When it was truncated, we could write 
'[...]' to the end of the buf to indicate truncation.)


Line 74:                if (len < vsprintf(buf, fmt, args))
vsprintf() will write past the buffer's end! You have to use vsnprintf() with a 
size arg.


-- 
To view, visit https://gerrit.osmocom.org/2961
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-HasComments: Yes

Reply via email to